I want to scale images these day and find the following example:
Example #1 of
http://www.codeproject.com/KB/GDI-plus/imageresize.aspx
After several testing, I write the following code:
static System.Drawing.Image Scale(System.Drawing.Image imgPhoto, int v_iPercent)
{
int destWidth = (int)(imgPhoto.Width * v_iPercent / 100.0);
int destHeight = (int)(imgPhoto.Height * v_iPercent / 100.0);
Bitmap bmPhoto = new Bitmap(imgPhoto, destWidth, destHeight);
return bmPhoto;
}
I am wondering why the example I find needs to use Graphics.DrawImage function to scale the image.
Have you seen what does the Bitmap constructor you are using do:
It calls DrawImage.