Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9283803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T18:43:24+00:00 2026-06-18T18:43:24+00:00

I am developing an Outlook 2010 Add-In, and am loading an image from a

  • 0

I am developing an Outlook 2010 Add-In, and am loading an image from a serialized XML file. The image loads fine, and am able to assign it to a pictureBox object on a Winform no problem. The object is saved in

[XmlIgnore]
public Bitmap Image
{
   get { return this.templateImage; }
   set { this.templateImage = value; }
 }

When, I attempt to save the physical file onto the harddisk however, I am doing:

string filePath = Path.Combine(dirPath, item.Id + ".jpg");
try
{
    item.Image.Save(filePath, System.Drawing.Imaging.ImageFormat.Jpeg);
}
catch (Exception e)
{
    Debug.WriteLine("DEBUG::LoadImages()::Error attempting to create image::" + e.Message);
}

and am getting an A generic error occurred in GDI+. I’ve checked the write permissions on the folder, and it does have write permissions. I’m unsure what is wrong here. I’ve also changed the ImageFormat to bmp and png and so forth to see if it was a conversion problem… but it isn’t. Would anybody suggest something to try?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T18:43:26+00:00Added an answer on June 18, 2026 at 6:43 pm

    Thank you to Simon Whitehead for answering this in the comments. He said, “3) Make sure the file is not in use by anything else (including your code).”

    So the problem was that my own code was using the item.Image object, and was preventing GDI+ to call the dispose() method on it. The solution was to copy the object into a new object, then use that object to “Write.” The resulting code is as follows:

    try
    {
       using (Bitmap tempImage = new Bitmap(item.Image)) 
       {
          tempImage.Save(filePath, System.Drawing.Imaging.ImageFormat.Png);
       }    
    }
    catch (Exception e)
    {
        Debug.WriteLine("DEBUG::LoadImages()::Error attempting to create image::" + e.Message);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a VSTO 2010 Office 2007 Outlook Add-In deployed from Click-Once. On
I'm developing an Outlook 2010 Add-In in C# which adds a docked Custom Task
I am developing an Outlook Add-in that is using Outlook contacts from local machine
I'm developing an outlook 2010 add-in in c#/.net. I have some items that I
I am developing add-in for Outlook 2010. I have to get all rules and
I'm developing an Add In for Outlook (2007 and 2010) using .NET4 to be
I am developing an add-in for outlook 2010. Basically, I have a button on
I am developing an outlook 2007 add-in which is based on an existing outlook
I am developing a small Outlook add-in which will fetch all information about selected
Background: I'm developing an Outlook 2007 Add-in in VS2010 in C#. The specific thing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.