loading texture from a Handle bitmap

Started by
1 comment, last by Emil_Halim 17 years, 6 months ago
does any one know how to load the data stored in Hbitmap (a handle of bitmap) into Gl texture. thanks in advance.
Advertisement
It's been a little while since I've gone GDI stuff, but I think GetObject will work:

// assuming hBitmap is your HBITMAPBITMAP 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.
thanks for help

[Edited by - Emil_Halim on October 21, 2006 6:32:24 AM]

This topic is closed to new replies.

Advertisement