A
Al
private void GetResizedImage(string imagePath, int width, int height, string destinationDirectory, string destinationFileName)
{
System.Drawing.Image image = System.Drawing.Image.FromFile( imagePath, true );
Bitmap thumbnail = new Bitmap( width, height, image.PixelFormat );
Graphics graphics = Graphics.FromImage( thumbnail );
graphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
Rectangle rectangle = new Rectangle(0, 0, width, height);
graphics.DrawImage( image, rectangle );
image.Dispose();
thumbnail.Save( destinationDirectory + "\\" + destinationFileName + "." + System.Drawing.Imaging.ImageFormat.Jpeg);
thumbnail.Dispose();
}
{
System.Drawing.Image image = System.Drawing.Image.FromFile( imagePath, true );
Bitmap thumbnail = new Bitmap( width, height, image.PixelFormat );
Graphics graphics = Graphics.FromImage( thumbnail );
graphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
Rectangle rectangle = new Rectangle(0, 0, width, height);
graphics.DrawImage( image, rectangle );
image.Dispose();
thumbnail.Save( destinationDirectory + "\\" + destinationFileName + "." + System.Drawing.Imaging.ImageFormat.Jpeg);
thumbnail.Dispose();
}