Get image dimension

Johny

Registered User.
Local time
Today, 09:10
Joined
Jun 1, 2004
Messages
80
Hello,

I use a image control on my form which i link to the image file. Users can click the image to see it at full size. For this to happen, I created a seperate form that contains another bigger image control that opens when the click event occurs.
My problem is the following: I want to know the original dimensions (not the dimensions of the small example) of the image, how do I do this? The only thing I have is the path to the image file. I was thinking: maybe I could create a new image object dynamically, get the height & width and destroy the object after but can't seem to get this wright :=/

I need the original dimensions so I can adapt the new form and image control dimensions at run time.


Thanx in advance,

greetz
 
This I tried:

Code:
dim intHeight as Integer
dim intWidth as Integer
dim imgTemp as Image

imgTemp.picture=strImagePath
intWidth=imgTemp.ImageWidth
intHeight=imgTemp.ImageHeight

When executed I get the following error (in dutch):

Objectvariabele of blokvariabele With is niet ingesteld

('good' english?)Objectvariable With is not set

Can anybody help me out with this, I am a total newbie at VBA :=/
 

Users who are viewing this thread

Back
Top Bottom