Tuesday, November 4, 2008

Resize Bitmap C#

public Bitmap ResizeBitmap(Bitmap b, int width, int height)
{
Bitmap result = new Bitmap(width, height);
using (Graphics g = Graphics.FromImage((Image)result))
g.DrawImage(b, 0, 0, width, height);

return result;
}

No comments: