我使用 asp.net system.drawing 以便在图像完成上传后使用以下代码生成缩略图:
//programmImages -- the id of the fileupload control
string path = "~/User/" + "progimgs/" + programmImages.FileName;
string thumbPath = "~/User/" + "thums/" + programmImages.FileName;
programmImages.SaveAs(Server.MapPath(path));
programmImages.Dispose();
//generating the tumbnails
System.Drawing.Image thum = System.Drawing.Image.FromFile(Server.MapPath(path));
System.Drawing.Image createTumb =
thum.GetThumbnailImage(250, 140, ()=>false, IntPtr.Zero);
createTumb.Save(thumbPath, ImageFormat.Jpeg);
我收到此错误“GDI+ 中发生一般错误”
在这一行“createTumb.Save(thumbPath, ImageFormat.Jpeg);”
什么问题,谢谢。