0
當我要在當時保存圖像時,我已經將imgpaths放入server.mappath()
中,我在GDI +錯誤中發生了一般性錯誤。在GDI中發生了一般性錯誤+
Graphics Grfx = Graphics.FromImage(bitmap);
Grfx.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
Grfx.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
Grfx.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality;
Grfx.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
Grfx.DrawImage(bitmap, 0, 0, wb.Width, wb.Height);
using (Bitmap img = bitmap.Clone() as Bitmap)
{
Bitmap newimage = img.Clone(new System.Drawing.Rectangle(0, 0, bitmap.Width, bitmap.Height), img.PixelFormat);
newimage.Save(imgpaths, System.Drawing.Imaging.ImageFormat.Jpeg); //Error:A generic error occurred in GDI+.
}
wb.Dispose();
不工作guffa –
@GuruprakashChinnsamy:運行代碼的用戶帳戶是否有寫入權限的文件夾? – Guffa
謝謝@guffa它現在的工作 –