how to set an image as background for dialog box or form
-
Hi, how to set an image as a background for dialog box or form in vc++? Thanks in advance..
-
Hi, how to set an image as a background for dialog box or form in vc++? Thanks in advance..
See the FAQ: 4.2: How do I change the background color of a dialog, or draw a picture in the background of my window?[^]
--Mike-- Dunder-Mifflin, this is Pam.
-
Hi, how to set an image as a background for dialog box or form in vc++? Thanks in advance..
void CClass::OnPaint() { CPaintDC dc(this); // device context for painting CPaintDC dcc(this); CRect rect; GetClientRect(&rect); CDC dcMem; dcMem.CreateCompatibleDC(&dc); CBitmap bmpBackground; bmpBackground.LoadBitmap(IDB_BITMAP1); //IDB_BITMAP1 is the image ID BITMAP bitmap; bmpBackground.GetBitmap(&bitmap); CBitmap *pbmpOld=dcMem.SelectObject(&bmpBackground); dc.StretchBlt(0,0,rect.Width(),rect.Height(),&dcMem,0,0, bitmap.bmWidth,bitmap.bmHeight,SRCCOPY); }
-
See the FAQ: 4.2: How do I change the background color of a dialog, or draw a picture in the background of my window?[^]
--Mike-- Dunder-Mifflin, this is Pam.
I wonder why your posting was down voted. I have compensated it. :)
«_Superman_» I love work. It gives me something to do between weekends.