CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2009
    Posts
    3

    ExternalException - A generic error occurred in GDI+

    I am loading an image into a picturebox using
    picturebox1.Image = Image.FromFile()

    and saving it by using

    Bitmap bm = new Bitmat(pictureBox1.Image);
    bm.Save(FileName, ImageFormat.Bmp);

    It works perfectly fine when creating a new file, but the moment you try to replace the existing image I get thrown a
    "ExternalException was unhandled - A generic error occurred in GDI+."

    Anythoughts on what I am doing wrong? Being able to replace the existing file is an important step in my program.

    Alright, I think i solved it by loading the image into a filestream, then loading the filestream into the picturebox.
    Last edited by ssice; December 23rd, 2009 at 08:15 PM. Reason: Problem Solved

  2. #2
    Join Date
    Jan 2010
    Posts
    5

    Re: ExternalException - A generic error occurred in GDI+

    Srange solution, isn't it?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured