GetBitmapInfo – Retrieve information on a bitmap

' This structure holds Bitmap informationPrivate Type BITMAP    bmType As Long    bmWidth As Long    bmHeight As Long    bmWidthBytes As Long    bmPlanes As Integer    bmBitsPixel As Integer    bmBits As LongEnd TypePrivate Declare Function GetObjectAPI Lib "gdi32" Alias "GetObjectA" (ByVal _    hObject As Long, ByVal nCount As Long, lpObject As Any) As Long' Get information on a bitmap'' PICT is the Picture property of a PictureBox control' WIDTH, HEIGHT return the size of the bitmap' COLORPLANES and BITSPERPIXELS return information on the resolution and color ' palette.'' Example:'    Dim wi As Long, he As Long, cp As Integer, bpp As Integer'    GetBitmapInfo Picture1.Picture, wi, he, cp, bpp'    Print "Width: " & wi'    Print "Height: " & he'    Print "Color Planes: " & cp'    Print "Bits per Pixel: " & bppSub GetBitmapInfo(pict As StdPicture, Width As Long, Height As Long, _    ColorPlanes As Integer, BitsPerPixel As Integer)    Dim bmp As BITMAP    GetObjectAPI pict, Len(bmp), bmp    Width = bmp.bmWidth    Height = bmp.bmHeight    ColorPlanes = bmp.bmPlanes    BitsPerPixel = bmp.bmBitsPixelEnd Sub

Share the Post:
Share on facebook
Share on twitter
Share on linkedin


Recent Articles: