Getting Size of an Image?

Discussion in 'ASP .Net' started by Brett Baisley, May 19, 2004.

  1. Hello

    I need help with some ASP.net programming. I have a web page that basically
    just has the following web components: dropdownlist, listbox and image.

    I am using VB.net with a CodeBehind file to read the contents of a directory
    into the dropdownlist. Then when the user picks one, it displays a list of
    the images in that dir in the listbox. Then when you pick a filename from
    the listbox, it displays the image.

    It all works, but I would like to do is if the image is bigger then 500
    pixels in width, I would like it to scale the image accordingly to max out
    at 500.

    The part I am having trouble is getting the size of the image to check it.
    Can anyone help?
    Brett Baisley, May 19, 2004
    #1
    1. Advertising

  2. Brett Baisley wrote:
    > I need help with some ASP.net programming. I have a web page that basically
    > just has the following web components: dropdownlist, listbox and image.
    >
    > It all works, but I would like to do is if the image is bigger then 500
    > pixels in width, I would like it to scale the image accordingly to max out
    > at 500.


    Brett, check out this article:

    Displaying a List of Scaled Images
    http://aspnet.4guysfromrolla.com/articles/011503-1.aspx

    The article shows how to dynamically determine an image's height & width
    in pixels.

    --

    Scott Mitchell

    http://www.4GuysFromRolla.com
    http://www.ASPFAQs.com
    http://www.ASPMessageboard.com

    * When you think ASP, think 4GuysFromRolla.com!
    Scott Mitchell [MVP], May 19, 2004
    #2
    1. Advertising

  3. Hey, that helped a lot. Thanks!

    "Scott Mitchell [MVP]" <> wrote in message
    news:...
    > Brett Baisley wrote:
    > > I need help with some ASP.net programming. I have a web page that

    basically
    > > just has the following web components: dropdownlist, listbox and image.
    > >
    > > It all works, but I would like to do is if the image is bigger then 500
    > > pixels in width, I would like it to scale the image accordingly to max

    out
    > > at 500.

    >
    > Brett, check out this article:
    >
    > Displaying a List of Scaled Images
    > http://aspnet.4guysfromrolla.com/articles/011503-1.aspx
    >
    > The article shows how to dynamically determine an image's height & width
    > in pixels.
    >
    > --
    >
    > Scott Mitchell
    >
    > http://www.4GuysFromRolla.com
    > http://www.ASPFAQs.com
    > http://www.ASPMessageboard.com
    >
    > * When you think ASP, think 4GuysFromRolla.com!
    Brett Baisley, May 19, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. karimL

    getting image size

    karimL, Jan 28, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    1,019
    KarimL
    Jan 28, 2004
  2. KarimL

    getting image size next....

    KarimL, Jan 28, 2004, in forum: ASP .Net
    Replies:
    11
    Views:
    648
    KarimL
    Jan 28, 2004
  3. Jason Cavett

    Preferred Size, Minimum Size, Size

    Jason Cavett, May 23, 2008, in forum: Java
    Replies:
    5
    Views:
    12,529
    Michael Jung
    May 25, 2008
  4. Bob Richardson
    Replies:
    3
    Views:
    219
    Bob Richardson
    Mar 8, 2005
  5. jodleren

    Getting picture size/setting window size

    jodleren, Feb 14, 2007, in forum: Javascript
    Replies:
    2
    Views:
    145
    jodleren
    Feb 15, 2007
Loading...

Share This Page