Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Image Resizing in ASP.net

Image Resizing in ASP.net

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dio22
    wrote on last edited by
    #1

    I need to display an image of unknown size (comes from a user supplied URL) in a panel of a fixed size. If the image is small it should appear centered in the panel, if it is larger than the panel, it needs to be scaled to fit. How would I go about doing this?

    F 1 Reply Last reply
    0
    • D Dio22

      I need to display an image of unknown size (comes from a user supplied URL) in a panel of a fixed size. If the image is small it should appear centered in the panel, if it is larger than the panel, it needs to be scaled to fit. How would I go about doing this?

      F Offline
      F Offline
      freshonlineMax
      wrote on last edited by
      #2

      You can set images with and height to your custum size. Like this : <asp:Image ID="Image1" runat="server" Height="100px" Width="100px" />

      D 1 Reply Last reply
      0
      • F freshonlineMax

        You can set images with and height to your custum size. Like this : <asp:Image ID="Image1" runat="server" Height="100px" Width="100px" />

        D Offline
        D Offline
        Dio22
        wrote on last edited by
        #3

        I don't want it to be a fixed size. I would like to scale down if needed, but not scale up. I would also like to keep the image height/width ratio.

        F 1 Reply Last reply
        0
        • D Dio22

          I don't want it to be a fixed size. I would like to scale down if needed, but not scale up. I would also like to keep the image height/width ratio.

          F Offline
          F Offline
          freshonlineMax
          wrote on last edited by
          #4

          Hello Dio22 Sorry about my late answernig I had problems like you have. You can solve it using below website: http://west-wind.com/weblog/posts/283.aspx[^] Also below link is very usefull: http://www.stardeveloper.com/articles/display.html?article=2003040501&page=1[^] If you had problem i can send you one sample code i worked on it by migrating results of above links. Regards Saeid

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups