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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top