General discussion

Locked

Size and shape of .bmp

By selfgov2000 ·
How can I detect the height and width of a .bmp file?

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Size and shape of .bmp

by mslizny In reply to Size and shape of .bmp

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.

Collapse -

Size and shape of .bmp

by selfgov2000 In reply to Size and shape of .bmp

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.

Collapse -

Size and shape of .bmp

by RSV In reply to Size and shape of .bmp

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...:)

Collapse -

Size and shape of .bmp

by Seagull Data Services In reply to Size and shape of .bmp

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

Collapse -

Size and shape of .bmp

by selfgov2000 In reply to Size and shape of .bmp

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.

Back to Windows Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums