Click to See Complete Forum and Search --> : Access bitmap bits from IBitmapDisp-type variable


madmanmarkau
July 30th, 2001, 07:27 PM
Hi. I have loaded a bitmap into a IBitmapBits-type variable called "BitmapData", and I want to directly read the bitmap bit data (24 bit) directly, or copy the data into an array. Thx.

cksiow
July 31st, 2001, 04:05 AM
hi, just wonder if the IBitmapBits is an interface or structure. where did u get it ??


HTH

cksiow
http://vblib.virtualave.net - share our codes

madmanmarkau
July 31st, 2001, 07:12 PM
****... It was a typo. it's actually IPictureDisp.

cksiow
July 31st, 2001, 09:52 PM
so, IPictureDisp, you probably is using picturebox control and would like to get the bitmap array from the picture. If not, just forget about the rest. but you should have a access to the bitmap file and can get it from there, of course, if it is JPeg, it would be more difficult.

okay, in order to put the data into an array, you need to use GetDIBits API, which take in hDC, and hBitmap. the hdc is the Picture1.Hdc, the hBitmap is Picture1.Picture.Handle.





HTH

cksiow
http://vblib.virtualave.net - share our codes