A generic error occurred in GDI+的解决方案

简介:

转自智慧光原文A generic error occurred in GDI+. 解决方法

 

使用image1.RotateFlip(RotateFlipType.Rotate90FlipNone)方法时候,出现错误:

An unhandled exception of type 'System.Runtime.InteropServices.ExternalException' occurred in System.Drawing.dll


Additional information: A generic error occurred in GDI+.


但是如果我在生成这个image类型的image1后直接调用image1.RotateFlip方法就没有问题。


原因:To retain access to the source bits, GDI+ locks any source file, and forces the application to maintain the life of any source stream, for the life of the Bitmap or the Image object.


 

位图和图像的构造函数依赖项

http://support.microsoft.com/?id=814675


解决方法:

 Image tmp = (Image)m_List[0];

   Bitmap tmpbitmap = new Bitmap(tmp);
   tmpbitmap.RotateFlip(RotateFlipType.Rotate90FlipNone);
 Image image1 = tmpbitmap;

 

没有整理与归纳的知识,一文不值!高度概括与梳理的知识,才是自己真正的知识与技能。 永远不要让自己的自由、好奇、充满创造力的想法被现实的框架所束缚,让创造力自由成长吧! 多花时间,关心他(她)人,正如别人所关心你的。理想的腾飞与实现,没有别人的支持与帮助,是万万不能的。


    本文转自wenglabs博客园博客,原文链接:http://www.cnblogs.com/arxive/p/6275766.html ,如需转载请自行联系原作者

相关文章
|
Java 数据库连接 数据库
ERROR 11848
ERROR 11848
174 1
|
9月前
|
机器学习/深度学习 Java Android开发
记录一个Flutter运行的异常FAILURE: Build failed with an exception. What went wrong: A problem occurred config
记录一个Flutter运行的异常FAILURE: Build failed with an exception. What went wrong: A problem occurred config
296 0
|
JavaScript 前端开发 开发者
Error,Error,到底什么是Error
总所周知,当系统运行出现错误的时候,就会抛出一个 Error ,那么这个 Error 是什么?它是怎么来的?它又是怎么被抛出的?它又是怎么被捕获的?这些问题,我们一起来探讨一下。
278 0
解决图片存入时 A generic error occurred in GDI+ 报错
解决图片存入时 A generic error occurred in GDI+ 报错
SignTool Error: An error occurred while attempting/Error information: “SignerTimeStamp() failed.“
SignTool Error: An error occurred while attempting/Error information: “SignerTimeStamp() failed.“
168 0
|
Java
Error: A JNI error has occurred, please check your installation and try again
Error: A JNI error has occurred, please check your installation and try again
227 0
C中error的使用
C中error的使用
107 0
|
关系型数据库 MySQL Linux
|
应用服务中间件 nginx
常见error
小榕
875 0
|
SQL 数据库
DBCC CHECKDB 遭遇Operating system error 112(failed to retrieve text for this error. Reason: 15105) encountered
我们一个SQL Server服务器在执行YourSQLDBa的作业YourSQLDba_FullBackups_And_Maintenance时遇到了错误:   Exec YourSQLDba.Maint.
1176 0

热门文章

最新文章