loading texture from a Handle bitmap
does any one know how to load the data stored in Hbitmap (a handle of bitmap) into Gl texture.
thanks in advance.
It's been a little while since I've gone GDI stuff, but I think GetObject will work:
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.
// 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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement