Who to get HBITMAP from BITMAPINFOHEADER and pdata bytes?

Who to get HBITMAP from BITMAPINFOHEADER and pdata bytes?

Post by Richar » Sun, 22 Jul 2007 02:02:57


I get bits data and image info
and i want to StretchBlt
but i don't how to convert to HBITMAP
Who to get HBITMAP from BITMAPINFOHEADER and pdata bytes?
thx!
 
 
 

Who to get HBITMAP from BITMAPINFOHEADER and pdata bytes?

Post by Mike D Sut » Wed, 25 Jul 2007 00:06:19

>I get bits data and image info

The easiest way is to use the StretchDIBits() API call, which doesn't require an HBITMAP and will simply take your
header and bytes directly then draw them to a DC. Alternatively if you want the HBITMAP for further work then use the
CreateDIBSection() API to create a GDI DIBSection object from header, then RtlMoveMemory() the image data into it.
Hope this helps,

Mike


- Microsoft Visual Basic MVP -
E-Mail: XXXX@XXXXX.COM
WWW: http://www.yqcomputer.com/