Solved

Bitmap as background of a CMiniFrame

Posted on 1997-11-28
3
242 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Shell script to login to remote m/c and execute commands 10 80
WinWaitActive parameters 12 31
Smart Camera scanning and reading information 3 126
FizzBuzz challenge 9 87
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

739 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