Hey fellers,
how can I find the height and width of a bitmap before I display it in a picture box?
Cheers!
Printable View
Hey fellers,
how can I find the height and width of a bitmap before I display it in a picture box?
Cheers!
[code}
'add a second picture box invisible
Private Sub Command1_Click()
Set Picture1 = LoadPicture("C:\images\dirtbagdog.jpg")
MsgBox Picture1.Picture.Width & " " _
& Picture1.Picture.Height
Set Picture1 = LoadPicture()
End Sub
[/code]
Or without the invisible picturebox
Code:Dim pic As IPictureDisp
Set pic = LoadPicture("SomePicture.bmp")
MsgBox pic.Height & " " _
& pic.Width
Picture1.Picture = pic
'that will work
'I would add this to get rid of unneeded baggage
'ie memory
'unload the picture and dump the object
Set pic = LoadPicture()
Set IPictureDisp = Nothing
cheers guys. I'd tried that before - I've tried about everything, but I omitted the "Set" in "Set pic= etc.", and it wouldn't work. I don't doubt it'll work now - thanx again...
Read the file header. You can get information about the header on www.wotsit.org