Solved

Bitmap as background of a CMiniFrame

Posted on 1997-11-28
3
238 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
difference between String.subString() and String.subSequence() 6 234
java ^ examples 8 69
Problem to event 3 102
Not needed 13 119
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 …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

856 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