This is a migrated thread and some comments may be shown as answers.

Release Image Resouce

1 Answer 73 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Shawn
Top achievements
Rank 1
Shawn asked on 06 Apr 2011, 03:28 PM
Hello,

I have a couple of pictureboxes in my report.  I programmatically bind an image file to a picturebox object using the following code.

pictureBox_Specimen1.Value = System.Drawing.

Image.FromFile(sketchpath.Path);

 


Before the report is created/displayed I can modify the image located at sketchpath.path.  After I open the report and then close it, I am no longer able to perform any IO on the image until I restart my application.

How do I have the report release the image resource?

In the report dispose event I have set the picturebox value to null and this does not help.

Any help would be greatly appreciated!

1 Answer, 1 is accepted

Sort by
0
Shawn
Top achievements
Rank 1
answered on 06 Apr 2011, 06:11 PM
Instead of loading the image from file I am now loading the image from memory and this seems to fix it for me.

If I do need to display an image from file the problem would still persist though.
Tags
General Discussions
Asked by
Shawn
Top achievements
Rank 1
Answers by
Shawn
Top achievements
Rank 1
Share this question
or