Resize an Image in C#
This function will let you resize an image in C#.
public static Bitmap Resize(Bitmap original,
int width, int height)
{
Bitmap bitmap = new Bitmap(width, height);
using (Graphics gfx = Graphics.FromImage(bitmap))
{
gfx.InterpolationMode
= Drawing2D.InterpolationMode.HighQualityBicubic;
gfx.SmoothingMode
= Drawing2D.SmoothingMode.HighQuality;
gfx.PixelOffsetMode
= Drawing2D.PixelOffsetMode.HighQuality;
gfx.CompositingQuality
= Drawing2D.CompositingQuality.HighQuality;
gfx.DrawImage(original, 0, 0, width, height);
return bitmap;
}
}