A generic error occurred in GDI + solutions

Source: Internet
Author: User

Turn from Smart light source A Generic error occurred in GDI +. Workaround

Use Image1. RotateFlip (Rotatefliptype.rotate90flipnone) method, an error occurred:

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


Additional information:a Generic error occurred in GDI +.


But if I'm calling Image1 directly after generating the image1 of this image type. There is no problem with the RotateFlip method.


Reason: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.


constructor dependencies for bitmaps and images

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


Workaround:

Image tmp = (image) m_list[0];

Bitmap Tmpbitmap = new Bitmap (TMP);
Tmpbitmap. RotateFlip (Rotatefliptype.rotate90flipnone);
Image image1 = Tmpbitmap;

A generic error occurred in GDI + solutions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.