How to Show a picture in SDI Application
-
Hi Friends, I am using an SDI Application, i want to show a BITMAP image in the SDI, How to do that.
Thanks and Regards. SANTHOSH V
-
Hi Friends, I am using an SDI Application, i want to show a BITMAP image in the SDI, How to do that.
Thanks and Regards. SANTHOSH V
for instance (inside
OnDraw
method of your View class):...
CBitmap *pOldBmp, bmp;
bmp.LoadBitmap(IDB_MY_BITMAP);
CRect rc;
GetClientRect(&rc);CDC dcMem;
dcMem.CreateCompatibleDC(pDC);
pOldBmp = dcMem.SelectObject(&bmp);
pDC->BitBlt(0,0,rc.right,rc.bottom, &dcMem,0,0,SRCCOPY);
dcMem.SelectObject(&pOldBmp);
...Please note: error handling and efficience tuning left to the reader. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
-
Hi Friends, I am using an SDI Application, i want to show a BITMAP image in the SDI, How to do that.
Thanks and Regards. SANTHOSH V
Or CImage m_Image; m_Image.Load(_T("c:\\1.jpg")); or 2.bmp m_Image.BitBlt(1024,768,dc._hDC); ...