Image Height and Width

T

tcb

Is it possible to know an image's height and width in pixel's before
importing it into a picture control?

This code will give the height and width in twips after it has been
brought in, and resize the control.

I'd really like to know the height and width in pixel's before I take
any other action.

Function GetNewPicture(frm As Form)
Dim ctlImage As Control
Set ctlImage = frm!image1
ctlImage.Picture = InputBox("Enter path and " _
& "file name for new bitmap")

Dim intHeight, intWidth As Integer
intHeight = ctlImage.ImageHeight
intWidth = ctlImage.ImageWidth

ctlImage.Height = intHeight
ctlImage.Width = intWidth

End Function
 
Top