0
我想缩放图像,这些天,找到下面的例子:两块代码约缩放图像
例子#1的 http://www.codeproject.com/KB/GDI-plus/imageresize.aspx
几个测试后,我写了下面的代码:
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;
}
我想知道为什么我找到的例子需要使用Graphics.DrawImage函数来缩放图像。
你在哪里找到位图构造函数的代码? – Billy 2009-11-04 08:07:39
红门的.NET反射器(http://www.red-gate.com/products/reflector/) – 2009-11-04 08:18:56