|
-
August 19th, 2009, 10:34 AM
#1
how to create 32bit color HBITMAP object
Hi Everyone,
I ran into a problem. I am creating a memory device context and a compatible bitmap object. It seems to be when I try to draw anything on it, it turns out to be black or white. I could not understand it. I pasted my code how I am creating the bitmap object.
Any idea will be helpful.
HDC hScreenDC = ::GetDC( NULL );
// Create memory DC
mDC = ::CreateCompatibleDC( hScreenDC );
// Create bitmap compatible with screen device context
mBitmap = ::CreateCompatibleBitmap( hScreenDC, 200, 200 );
mOldBitmap = (HBITMAP)::SelectObject( mDC, mBitmap );
Thanks in advance.
Regards.
-
August 19th, 2009, 11:45 AM
#2
Re: how to create 32bit color HBITMAP object
Post more code. You don't show anything at all on how you're drawing to your bitmap, nor how you're bliting it back to the dc.
-
August 28th, 2009, 08:03 PM
#3
Re: how to create 32bit color HBITMAP object
::CreateCompatibleDC(NULL) will create a dc compatible with the screen.
I don't understand why do you use CreateCompatibleBitmap if you state you need a 32 bit bitmap. Use CreateBitmap.
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
|