PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
Size of .jpg file-VBForums
Results 1 to 4 of 4

Thread: Size of .jpg file

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2005
    Posts
    14

    Size of .jpg file

    Can anyone tell me how I can check the size (Height & Width) of a .jpg file through vb6?

  2. #2
    Frenzied Member Andrew G's Avatar
    Join Date
    Nov 2005
    Location
    Sydney
    Posts
    1,587

    Re: Size of .jpg file

    VB Code:
    1. Dim Pic As IPictureDisp
    2.  
    3. Private Sub Form_Load()
    4.     Set Pic = LoadPicture("D:\picture.jpg")
    5.    
    6.     Imgwidth = Me.ScaleX(Pic.Width, vbHimetric, vbPixels)
    7.     ImgHeight = Me.ScaleY(Pic.Height, vbHimetric, vbPixels)
    8.    
    9.     MsgBox "Picture demensions: " & Imgwidth & " x " & ImgHeight
    10.  
    11. 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

  3. #3
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    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.


  4. #4
    Frenzied Member Andrew G's Avatar
    Join Date
    Nov 2005
    Location
    Sydney
    Posts
    1,587

    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
  •  



Featured


Click Here to Expand Forum to Full Width