devxlogo

GetBitmapInfo – Retrieve information on a bitmap

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

See also  Comparing different methods of testing your Infrastructure-as-Code
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist