Quote:
>Hi All !
>I am trying to get the dimensions of "*.jpg" and "*.gif" - files.
>There have to be a better solution than cheating by preloading it into a
>hidden PicBox & read it from there....
>I got bitmaps(*.bmp) right, by sending a BITMAP to GetObjectAPI, but I don't
Help for LoadPicture Function:
"Graphics formats recognized by
Visual Basic include bitmap (.bmp)
files, icon (.ico) files, cursor (.cur) files, run-length encoded (.rle)
files, metafile (.wmf) files, enhanced metafiles (.emf), GIF (.gif)
files, and JPEG (.jpg) files."
Dim xpixels As Long, ypixels As Long
Dim filename As String
Dim APicture As Picture
filename = "whatever"
Set Apicture = LoadPicture(filename)
xpixels = Me.ScaleX(APicture.Width, vbHimetric, vbPixels)
ypixels = Me.ScaleY(APicture.Height, vbHimetric, vbPixels)
Set Apicture = Nothing
Getting the dimensions of jpg and gif directly from the disk file is
nightmarish, and just not worth the effort when you can use the above
code.
--
Richard Mason