dcsimg
Results 1 to 2 of 2

Thread: How to get Image Width & Height?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2004
    Location
    Croatia
    Posts
    23

    Unhappy How to get Image Width & Height?

    I need to get Width and Height of Image in Image control.
    I'm loading images from the code, it works Ok, but cannot get...

    Image1.Width.ToString
    and
    Image1.Height.ToString

    ...to work, it always returns nothing. Like there's no width...set, but the image loaded in control is the right size.
    I cannot set Width and Height to control in design view cos' every image has diffrent dimensions.

    Please help!
    ASP .NET 2.0, VISUAL BASIC .NET 2005

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,174

    Re: How to get Image Width & Height?

    Create an Image object, and load your image using the path you have using its FromFile() method.

    Then simply access the height and width properties.

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