我正在尝试使用以下代码调整位图的大小,我在第二行收到错误:
Image src = Image.FromFile(@"D:\Microsite\TestASP\Images\logo.png");
Bitmap newImage = new Bitmap(600,600); //error occurs on this line
using (Graphics gr = Graphics.FromImage(newImage))
{
gr.SmoothingMode = SmoothingMode.HighQuality;
gr.InterpolationMode = InterpolationMode.HighQualityBicubic;
gr.PixelOffsetMode = PixelOffsetMode.HighQuality;
gr.DrawImage(src, new Rectangle(0, 0, 300, 300));
}
我得到的错误是
不支持网址格式