Received text message

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.