Discussion Locked

Size and shape of .bmp

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
How can I detect the height and width of a .bmp file?

5 replies

by mslizny

A .bmp file is measured in pixels. On a high-resolution screen it will appear smaller than on a low-resolution screen. If you are writing HTML you can specify a size, otherwise you are at the mercy of your screen or your user's screen.

by selfgov2000

I guess I wasn't clear enough with my question. I want to know how to open up a .bmp file in Visual FoxPro (or some other language) and read something that will give me the height pixels and width pixels.

by rsv

HI,
You can get the height and width of the .bmp file, using Visual Basic.
1.Place a PictureBox control on the form.
2.Change the AutoSize=True
3.Select the bmp file for the Picture property of the PictureBox.
4.After selecting the bmp file forthe PictureBox, you can see the Height & Width of the PictureBox, those are the height and width of your .bmp file.

Hope this helps you.
GOOD LUCK...:)

by seagull data services

RSV is correct but it's not necessary to show or re-size the picture, merely loading it and accessing the picture's (as opposed to the picturebox's) height and width properties will do the trick. e.g.
Me.Picture1.Picture = LoadPicture("c:\heartflwrbck.gif")
MsgBox "Height=" & Me.Picture1.Picture.Height & vbCrLf & _
"Width =" & Me.Picture1.Picture.Width, _
vbInformation, "Voila"
HTH
John

by selfgov2000

I guess what I am really looking for is header format for .bmp. I have learned that .pcx contains the height and width information in bytes 5-16 of the header. It would be nice to know of a windows function that would just read that for a .bmp, but if I had the format, I could manage. I shouldn't have said "or other language" . FoxPro is kind of an entity unto itself.

This discussion is closed to new replies.