Sign in to follow this  
Emil_Halim

loading texture from a Handle bitmap

Recommended Posts

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this