-
January 27th, 2006, 01:01 AM
#1
displaying bitmap
hello all..after refering to the past posts on displaying bitmaps...
i tried the following codes in OnDraw
Code:
CBitmap bmp;
bmp.LoadBitmap(IDB_BITMAP1);
BITMAP bm;
bmp.GetObject(sizeof(BITMAP), &bm);
CDC memDC;
memDC.CreateCompatibleDC(pDC);
CBitmap* pOld = memDC.SelectObject(&bmp);
pDC->BitBlt(50, 50, bm.bmWidth, bm.bmHeight, &memDC, 50, 50 , SRCCOPY);
memDC.SelectObject(pOld);
But after running the program, nothing is being display. Please help see where the error might be.
Thanks alot!
-
January 27th, 2006, 02:42 AM
#2
Re: displaying bitmap
pDC->BitBlt(50, 50, bm.bmWidth, bm.bmHeight, &memDC, 50, 50 , SRCCOPY);
pDC->BitBlt(50, 50, bm.bmWidth, bm.bmHeight, &memDC, 0, 0, SRCCOPY);
-
January 27th, 2006, 06:19 AM
#3
Re: displaying bitmap
Originally Posted by ljaydenl
hello all..after refering to the past posts on displaying bitmaps...
i tried the following codes in OnDraw
Code:
CBitmap bmp;
bmp.LoadBitmap(IDB_BITMAP1);
BITMAP bm;
bmp.GetObject(sizeof(BITMAP), &bm);
CDC memDC;
memDC.CreateCompatibleDC(pDC);
CBitmap* pOld = memDC.SelectObject(&bmp);
pDC->BitBlt(50, 50, bm.bmWidth, bm.bmHeight, &memDC, 50, 50 , SRCCOPY);
memDC.SelectObject(pOld);
But after running the program, nothing is being display. Please help see where the error might be.
Thanks alot!
Check if IDB_BITMAP1 is there in your project resource or something..
-
January 27th, 2006, 02:18 PM
#4
Re: displaying bitmap
this thread can help: Help with displaying bitmaps
Cheers
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|