-
Feb 13th, 2006, 01:14 AM
#1
Thread Starter
New Member
Size of .jpg file
Can anyone tell me how I can check the size (Height & Width) of a .jpg file through vb6?
-
Feb 13th, 2006, 01:28 AM
#2
Re: Size of .jpg file
VB Code:
Dim Pic As IPictureDisp
Private Sub Form_Load()
Set Pic = LoadPicture("D:\picture.jpg")
Imgwidth = Me.ScaleX(Pic.Width, vbHimetric, vbPixels)
ImgHeight = Me.ScaleY(Pic.Height, vbHimetric, vbPixels)
MsgBox "Picture demensions: " & Imgwidth & " x " & ImgHeight
End Sub
Oops the size was in HiMetric units so you had to change it. Fixed now
Last edited by Andrew G; Feb 13th, 2006 at 02:31 AM.
Reason: Fix code
-
Feb 13th, 2006, 02:14 AM
#3
Re: Size of .jpg file
will it give exact dimensions without making its streatch=false...
If an answer to your question has been helpful, then please, Rate it!
Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.
-
Feb 13th, 2006, 02:35 AM
#4
Re: Size of .jpg file
The code given doesn't need any controls. It loads the picture into memory and then gets the size, so in anwser to your question yes as it can't stretch the pic.
Last edited by Andrew G; Feb 13th, 2006 at 06:22 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|