Bitmap bmp =newBitmap(path);//path是图片路径 pictureBox_qr_code_create.Image = bmp; 修改后的程序为: 1 2 3 Bitmap bmp =newBitmap(path); Bitmap bt =newBitmap(bmp); pictureBox_qr_code_create.Image = bt; 这样处理后我的问题就解决了。
This problem occurs because until the bitmap object is disposed, it creates a lock on the underlying image file. So you can save the newly generated file with different name but not overwrite the file because of lock.Now suppose you want to overwrite the file then create another bitmap from...
this.myBitmap.Save("Output\out.bmp" , System.Drawing.Imaging.ImageFormat.Bmp ); } } } This runs fine until the SavePicture(...) function is called. I get the exception: "A generic error occurred in GDI+." at the this.myBitmap.Save(...); line. Most likely there is some detail...
Bitmap.save(): A generic error occurred in GDI+ Try the following code You will get the above mentioned error:A generic error occurred in GDI+. DimoBitmapAsBitmap oBitmap =NewBitmap("c:\example.jpg") DimoGraphicAsGraphics oGraphic = Graphics.FromImage(oBitmap) DimoBrushAsNewSolidBrush(...
Bitmap.save(): A generic error occurred in GDI+ Try the following code You will get the above mentioned error:A generic error occurred in GDI+. DimoBitmapAsBitmap oBitmap =NewBitmap("c:\example.jpg") DimoGraphicAsGraphics oGraphic = Graphics.FromImage(oBitmap) ...
when calling bitmap.Save with a file path where the folder doesn't exist the save method throws a System.Runtime.InteropServices.ExternalException: 'A generic error occurred in GDI+.' IMHO the the folder should be created (to match folde...
1. “A generic error occurred in GDI+”的含义 这个错误消息表示在使用GDI+(Graphics Device Interface Plus)进行图形或图像处理时发生了一个通用错误。GDI+是.NET Framework中用于处理图形、图像和文本的一个组件。由于GDI+是对底层图形设备的封装,这个错误可能由多种原因引起,包括但不限于文件访问问题、内存不足...
应该是服务器上文件夹的权限问题。设置用户或everyone的读写权限试试
Bitmap.save() --- A generic error occurred in GDI+ 问题解决方法 2011-09-16 15:28 −最近的一个项目中在处理数据绘制图表时,在进行bitmap.save()时偶尔遇到上述问题“ A generic error occurred in GDI+”。由于项目中代码量较大,这里只转载网络上解决文章中的VB代码。原文链接地址:http://blog.vis...
简介: 解决图片存入时 A generic error occurred in GDI+ 报错 在下载远程图片时存入磁盘报错语句 img.Save(filePath, System.Drawing.Imaging.ImageFormat.Jpeg); 首先检查了文件夹权限的问题,还是不行图片写不进去 后来网上查找是因为我在读取图片时,它会将图片锁定 Bitmap bmp = new Bitmap(img);//新建一...