Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: VB4/32,VB5,VB6
Expertise: Intermediate
Apr 7, 2001



Application Security Testing: An Integral Part of DevOps

GetBitmapInfo - Retrieve width, height and colors in a 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 Declare Function GetObjectAPI Lib "gdi32" Alias "GetObjectA" (ByVal _
    hObject As Long, ByVal nCount As Long, lpObject As Any) As Long

' Returns info on a bitmap loaded into a picture
' Pass the Picture property in the first argument
' Find the results in the remaining arguments

Sub GetBitmapInfo(ByVal handle As Long, width As Integer, height As Integer, _
    Optional colorPlanes As Integer, Optional bitsperpixel As Integer)
    Dim bmp As BITMAP
    ' call the API
    GetObjectAPI handle, Len(bmp), bmp
    ' return values throgh argumens
    width = bmp.bmWidth
    height = bmp.bmHeight
    colorPlanes = bmp.bmPlanes
    bitsperpixel = bmp.bmBitsPixel
End Sub

Francesco Balena
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date