Can anyone tell me how I can check the size (Height & Width) of a .jpg file through vb6?
Printable View
Can anyone tell me how I can check the size (Height & Width) of a .jpg file through vb6?
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 :)
will it give exact dimensions without making its streatch=false...
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. :)