Solved

Bitmap as background of a CMiniFrame

Posted on 1997-11-28
3
234 Views
Last Modified: 2013-11-20
How do I load a huge bitmap to be the background of a CMiniFrame?
Below is the code i used to create the miniframe.  

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
...etc..

CString strClass = AfxRegisterWndClass(CS_VREDRAW|CS_HREDRAW,::LoadCursor(NULL, IDC_ARROW),(HBRUSH)::GetStockObject(WHITE_BRUSH),::LoadIcon(NULL,IDI_APPLICATION));

CRuntimeClass * pRuntimeClass = RUNTIME_CLASS(CMyMiniFrame);
MyMiniFrame = (CMyMiniFrame*)pRuntimeClass->CreateObject();
MyMiniFrame->Create(strClass,_T("My MiniFrame Window"), MFS_MOVEFRAME, CRect(50,50,200,130));
}
0
Comment
Question by:engllf
  • 2
3 Comments
 

Author Comment

by:engllf
ID: 1311036
Edited text of question
0
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 50 total points
ID: 1311037
Since you're creating the class yourself, you will need to override the WM_PAINT and WM_ERASEBKGND messages in your CMyMiniFrame class. Then you can draw the bitmap in any fashion you like.
0
 

Author Comment

by:engllf
ID: 1311038
Do you have any sample code for OnPaint{},OnEraseBkgnd()?
I tried to write them but i simply get no where.
Thanks
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Different colored text in ComboBox without Subclassing 8 45
bobThere java chalenge 45 85
withoutTen challenge 14 88
Sed question 2 48
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now