0

In WebForm, I use a control Image or ImageButton; is possible to resize an image, according to the ratio, t ? to fit the size of the control, the property Stretch is non-applicable.

If not possible in C# other ways as well JQuery, or javascript? Ex. the pictures is 1635px x 2048 and the control 332px x 420 ratio 0.79

Pravitha V
  • 3,308
  • 4
  • 33
  • 51
Maurizio
  • 17
  • 1
  • Possible duplicate of [Resize an Image C#](https://stackoverflow.com/questions/1922040/resize-an-image-c-sharp) – Shiham Aug 02 '17 at 06:00
  • Write some code/research? plenty of .net cropping/resizing controls out there... – Tez Wingfield Aug 02 '17 at 11:05
  • Here i found an Example http://www.c-sharpcorner.com/blogs/resize-image-before-uploading1 var thumbImg = new Bitmap(newWidth, newHeight); // Save the file string targetPath = Server.MapPath(@"~\Images\") + FileUpload1.FileName; // the image is a jpg , but also on Png is same // on execute i have an exception error // generic error GDI thumbImg.Save(targetPath, image.RawFormat); – Maurizio Aug 02 '17 at 16:21

0 Answers0