Image Resizing in ASP.net
-
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?
-
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?
You can set images with and height to your custum size. Like this : <asp:Image ID="Image1" runat="server" Height="100px" Width="100px" />
-
You can set images with and height to your custum size. Like this : <asp:Image ID="Image1" runat="server" Height="100px" Width="100px" />
-
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.
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