Hi there I want to resize my image and save it by fileupload in my path.
I found this code:
public static System.Drawing.Image ResizeImage(System.Drawing.Image sourceImage, int width, int height)
{
System.Drawing.Image oThumbNail = new Bitmap(sourceImage, width, height);
Graphics oGraphic = Graphics.FromImage(oThumbNail);
oGraphic.CompositingQuality = CompositingQuality.HighQuality;
oGraphic.SmoothingMode = SmoothingMode.HighQuality;
oGraphic.InterpolationMode = InterpolationMode.HighQualityBicubic;
Rectangle oRectangle = new Rectangle(0, 0, width, height);
oGraphic.DrawImage(sourceImage, oRectangle);
return oThumbNail;
}
now how can I show this image?
like Image1.....=ResizeImage(....)
what should i write?
Member
112 Points
398 Posts
Resize Image
Jan 15, 2012 05:33 AM|vahid.ch|LINK
Hi there I want to resize my image and save it by fileupload in my path.
I found this code:
Participant
1523 Points
508 Posts
Re: Resize Image
Jan 15, 2012 10:45 AM|sudeep_13|LINK
Hi,
Pls refer below link
http://weblogs.asp.net/gunnarpeipman/archive/2009/04/02/resizing-images-without-loss-of-quality.aspx
Please mark the post as "Answer" if it helps you.