CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 1999
    Posts
    5

    Height and Width for gif and jpg

    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?


  2. #2
    Join Date
    Apr 1999
    Location
    Netherlands
    Posts
    181

    Re: Height and Width for gif and jpg

    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 :-)

  3. #3
    Join Date
    Aug 1999
    Location
    India-Delhi
    Posts
    106

    Re: Height and Width for gif and jpg

    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

  4. #4
    Join Date
    Jul 1999
    Posts
    5

    Re: Height and Width for gif and jpg

    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


  5. #5
    Join Date
    Apr 1999
    Location
    Netherlands
    Posts
    181

    Re: Height and Width for gif and jpg

    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 :-)

  6. #6

    Re: Height and Width for gif and jpg

    See http://www.freevbcode.com/ShowCode.Asp?ID=112.
    It is a whole class designed for this purpose.


  7. #7
    Join Date
    Jul 1999
    Posts
    5

    Re: Height and Width for gif and jpg

    Thank you,this worked perfectly!


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured