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