Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
  Database
Automation
OS/Networking
Graphics
Links
Tools
» Regular Expr Tester
» Free Tools

GetBitmapInfo - Retrieve information on a bitmap

Total Hit ( 3333)

Rate this article:     Poor     Excellent 

 Submit Your Question/Comment about this article

Rating


 


Click here to copy the following block
' This structure holds Bitmap information
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 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: " & bpp

Sub 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.bmBitsPixel
End Sub


Submitted By : Nayan Patel  (Member Since : 5/26/2004 12:23:06 PM)

Job Description : He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting.
View all (893) submissions by this author  (Birth Date : 7/14/1981 )


Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.