Saturday, July 19th, 2008
Image Resize With CSharp
Often it is necessary to resize an image that has been uploaded. To do this you will need the following using classes:-
using System.Drawing;
using System.Drawing.Imaging;
Then here are some examples on functions with the resize code:-
public static string ResizeImageAndSave(int Width, int Height, string imageUrl,string destPath)
{
System.Drawing.Image fullSizeImg = System.Drawing.Image.FromFile(HttpContext.Current.Server.MapPath(imageUrl));
[...]