Board index » Visual Studio » add a picture to MFC view
|
ladysbytes
|
|
ladysbytes
|
add a picture to MFC view
Visual Studio317
Hi, Anybody know how to add a existing picture to MFC view, the picture already in c:\, thanks a lot! -ja - |
| armancho_x
Registered User |
Tue Oct 10 04:56:02 CDT 2006
Re:add a picture to MFC view
Hi,
// First load image; HANDLE hImage = ::LoadImage( AfxGetInstanceHandle(), lpszFileName, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE); // Then, pass it to CBitmap; CBitmap bmp; bmp.Attach(hImage); // Get sizes; BITMAP b; bmp.GetObject(sizeof (b), &b); // Create in-memory device for client area of the view CDC mdc; mdc.CreateCompatibleDC(NULL); // Now use bmp, b, mdc and your view's dc to draw the picture. -- ====== Arman "ja" wrote: QuoteHi, |
| Ajay
Registered User |
Tue Oct 10 10:30:36 CDT 2006
Re:add a picture to MFC viewQuoteAnybody know how to add a existing picture to MFC view, the picture msdn.microsoft.com/msdnmag/issues/01/10/c/">msdn.microsoft.com/msdnmag/issues/01/10/c/ --- Ajay - |
| ja
Registered User |
Tue Oct 10 20:11:13 CDT 2006
Re:add a picture to MFC view
Cool, thanks a lot!
"Arman Sahakyan" <armancho_x@rambler.ru(donotspam)>дÈëÏûÏ¢ÐÂÎÅ:8BE3E65F-E377-4681-87DB-15951F3F7369@microsoft.com... QuoteHi, - |
