How can get the width and height for a gif or jpg file? I need this feature in an ActiveX-dll running on a webserver so I mustn't use forms or formcontained controls. Can I get the info by parsing the file?
Printable View
How can get the width and height for a gif or jpg file? I need this feature in an ActiveX-dll running on a webserver so I mustn't use forms or formcontained controls. Can I get the info by parsing the file?
You probably can parse it too, but you can declare a variable as Picture, use LoadPicture to load the gif/jpg, and use Picture.Width and Picture.Height to get the width and height (don't forget to set the variable to nothing after using it :-)
Crazy D @ Work :-)
Hi,
If I rightly understood your question, Then you can always get height and width of any picture by just placing it in any html development tool like front page, hot dog and look at the image property.
Good Luck
Santulan
Thanks for the tip, but as I need the width and height in pixels, I would have to use ScaleX/Y which demands a form
Nope, to convert twips to pixels, use Screen.TwipsPerPixelX and Screen.TwipsPerPixelY
(on most machines these values are 15, but you better use this instead of hardcoding 15)
Crazy D @ Work :-)
See http://www.freevbcode.com/ShowCode.Asp?ID=112.
It is a whole class designed for this purpose.
Thank you,this worked perfectly!