Add a picture control and a commandbutton control to form, add a bitmap file to the picture control, and Code Add:
Private declare function GetObject lib "GDI32" alias "getobjecta "_
(Byval hobject as long, byval ncount as long, lpobject as any )_
As long
Private declare function getbitmapbits lib "GDI32" (byval hbitmap as long ,_
Byval dwcount as long, lpbits as any) as long
Private type bitmap
Bmtype as long
Bmwidth as long
Bmheight as long
Bmwidthbytes as long
Bmplanes as integer
Bmbitspixel as integer
Bmbits as long
End type
Private sub commandementclick ()
Dim hbitmap as long
Dim res as long
Dim BMP as bitmap
Dim byteary () as byte
Dim totbyte as long, I as long
Hbitmap = picture1.picture. Handle
Res = GetObject (hbitmap, Len (BMP), BMP) 'to obtain the bitmap Structure
Totbyte = BMP. bmwidthbytes * BMP. bmheight 'total number of bytes to store the Graph
Redim byteary (totbyte-1)
'Save the Graph Information in picture1 to byteary
Res = getbitmapbits (hbitmap, totbyte, byteary (0 ))
debug. print "Total Bytes copied:"; Res
debug. print "BMP. bmbits "; BMP. bmbits
debug. print "BMP. bmbitspixel "; BMP. bmbitspixel 'number of elements per second
debug. print "BMP. bmheight "; BMP. bmheight' calculate the Image Height in a prime phase
debug. print "BMP. bmplanes "; BMP. bmplanes
debug. print "BMP. bmtype "; BMP. bmtype
debug. print "BMP. bmwidth "; BMP. bmwidth 'calculates the image width in a prime.
debug. print "BMP. bmwidthbytes "; BMP. bmwidthbytes: the length of each scanned line in bytes
end sub