   Displaying resource bitmaps
  Hey, I''m a little confused about using bitmaps in GDI. Basically, I''ve got a small bitmap that''s loaded into the exe as a resource. And I have two questions:1. I''m using LoadBitmap() and I get an HBITMAP returned. How can I get the pixel dimensions from that handle? I looked at GetBitmapDimensionEx(), but it says it works only if the dimensions have been set with SetBitmapDimensionEx(). I can''t figure out how to access the bitmap header structs, which contain the info I need. Does GetDIBits() do it?2. Is there any way I can use that handle to blit to the back buffer HDC? Or do I have to create another (compatible) DC first, select in the bitmap, and then use BitBlt()? Seems like a waste to do all that. I just need to copy the BMP to the back buffer one time.Thanks in advance.kingnosis 
  For the first question, you can access the BITMAP structure associated with a HBITMAP by using the GetObject() function. bmHeight and bmWidth should contain the dimensions of the image.For the second question, I think you should be able to use it directly. Why not try it out and then let us know how it goes? ;  1) As SiCrane says.2) Yep, you need to create a compatible DC, select your bitmap, do the BitBlt, select the old bitmap (returned by SelectObject()) back into the DC, then delete the DC (unless you want to keep it around to reuse, that way you only need one DC).;  Thanks. It's working now. I'm using GetObject() and I'm making a temporary DC.   [edited by - kingnosis on February 15, 2004 11:50:50 PM]