Not a Member Yet,
Click here to Register
How do you like the new design?






ID: 346
Viewed: 2844
Added: Aug 19, 2002
Version:
Snippet uploaded by: snippet
Written By: Unknown
Demo: Sorry, no demo



User Rated at: 0 Stars
Rate This:

Thank you for your vote. Please wait...

It appears you already voted for this snippet

It appears your vote value was empty

reads the BMP header information

Highlight all by clicking in box
<!---Declaration--->
none

Highlight All
<!---Code--->
Option Explicit

Private Type BITMAPINFOHEADER
biSize As Long
biWidth As Long
biHeight As Long
biPlanes As Integer
biBitCount As Integer
biCompression As Long
biSizeImage As Long
biXPelsPerMeter As Long
biYPelsPerMeter As Long
biClrUsed As Long
biClrImportant As Long
End Type

Private Type BITMAPFILEHEADER
bfType As Integer
bfSize As Long
bfReserved1 As Integer
bfReserved2 As Integer
bfOffBits As Long
End Type

Public Type BITMAPINFO
Width As Long
Height As Long
End Type


Public Function GetBMPInfo(psPath As String) As BITMAPINFO
Dim f As Integer
Dim tmp As String
Dim FileHeader As BITMAPFILEHEADER
Dim InfoHeader As BITMAPINFOHEADER
Dim i As BITMAPINFO

On Error Resume Next

f = FreeFile
Open psPath For Binary Access Read As #f
Get #f, , FileHeader
Get #f, , InfoHeader
Close #f

i.Width = InfoHeader.biWidth
i.Height = InfoHeader.biHeight

GetBMPInfo = i
End Function;


No Comments to show

Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.


Replying to a Comment...


Adding your comment. Please wait...

Thanks for adding your comment!. After further review it will be added.

There was a problem adding your comment. Please try again.

Please complete all the fields in the form before sending.

© 2002 - 2017 snippetlibrary.com All Rights Reserved. Conditions