[thelist] Byte Array <-> StdPicture VB6?
listman at hazard0us.org
listman at hazard0us.org
Fri Oct 25 04:33:00 CDT 2002
You could possibly using the win32 API.
I know that the picture supports a property that directly maps to a win32
HBITMAP
(I think its called Picture.image or something)
1)
You will have to declare a structure (type) in vb that maps to the win32
BITMAP
strucuture (should be documented in MSDN)
2)
Use the win32 GetObject API to get the dimensions of the
image in the picture image ,
something like :
GetObject Pic.Image,sizeof(BITMAP), BITMAP
3)
Create a Byte() array in vb that is of the calculated size in step (2) and
copy the raw bitmap
to the byte array using the GetBitmapBits win32 API.
something like :
GetBitmapBits Pic.image, 0, byteArr
the vb byte array should now contain your stdPicture as a byte array
HTH
ashok
------
Ashok Hariharan
http://www.unganisha.org
------
More information about the thelist
mailing list