When reading through files in dir - can I get size of jpeg's?

  • Thread starter Thread starter Jesper F
  • Start date Start date
J

Jesper F

I know how to read through a directory and place the file
names in a table.
But is it possible to read through a directory with image
files (jpg) and obtain the size/dimensions in pixels of
each image?

Thanks for any help.
 
Ok, this is not an ideal solution, but it might work for you:

Dim f As String
f = "myPicture.jpg"

Dim im As Object

Form_Form2.Image1.Picture = f
MsgBox Form_Form2.Image1.ImageWidth / 15
MsgBox Form_Form2.Image1.ImageHeight / 15

I've embedded an invisible picture control on this form and I use it to load
the image. I then ask it to give me the details on the image. The "/ 15"
converts the number it returns into screen pixels.
Hope that might get you closer. Post back if you still have questions.
 
Ok, this is not an ideal solution, but it might work for you

Hi Bryan, thanks for your answer. I think this will work for me.
I'm importing lists of files to tables in access. This has to do with picture galleries on a web site, where I keep the pictures for the site in a directory
I needed info about the image file in order to display it correctly (width, height) so I'll simply run all the files through the imageframe in order to get that information and it should work
Thanks for your help. I'll post again if I can't get it to work
 
Back
Top