• Advertisement
Sign in to follow this  

loading texture from a Handle bitmap

This topic is 4107 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

does any one know how to load the data stored in Hbitmap (a handle of bitmap) into Gl texture. thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
It's been a little while since I've gone GDI stuff, but I think GetObject will work:


// assuming hBitmap is your HBITMAP

BITMAP bitmap;

GetObject(hBitmap,sizeof(bitmap),&bitmap);


Then, you should just be able to access the bits from bitmap.bmBits. Be careful, though...if it's a DIB (device-independent bitmap) your bits should be in left-right, top-down format. But if it's a traditional bitmap, it'll probably be in left-right, bottom-top format.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement