标签:.com 类型 dll target occurred net form top ret
转自智慧光原文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;
A generic error occurred in GDI+的解决方案
标签:.com 类型 dll target occurred net form top ret
原文地址:http://www.cnblogs.com/arxive/p/6275766.html