Do you absolutely need to keep all those file handles open? Can't you read the file contents into Image and close each file as you go? Post 2 in this thread has an example:
http://www.vbdotnetforums.com/graphics-gdi/21341-how-do-i-remove-reference-file-gdi-exception.html
Do I have to? No.
Do I want to? Yes
Because of the way I'm processing and displaying the imagery, loading to/from disk for every operation I perform is too slow. I want all images to be in memory for instant access.
I had a look at your code segment, and I confess I'm not sure if my understanding of GDI+ is correct, or if the code segment is in error.
This may get complicated but I will try to be clear.
I assume picLogo is a picture box on the form. Program flow is as follows:
Create a dialog.
Load an image to a bitmap from disk.
Create a graphics object.
Process the bitmap, display result in picLogo and save result to disk.
Ok so far but what follows is confusing. The dialog is disposed, something I have never seen in any MS docs. And the graphics object is not disposed. In the MS docs graphics objects are always disposed, otherwise they remain persistent. The bitmap looses scope once the routine is finished.
I'm not sure if this is a code error, or if your saying this resolves my issue.
My project runs much nicer with all images in memory. I thought that in order to keep all my images in memory the file references need to remain open. So I wonder if what your saying is I can accomplish this by creating a unique graphics object for each image, and disposing of the dialog will close the file references while keeping the images in memory. If so I would have another question or two. If not then we are not talking about the same thing.
On another matter, I will research the FAQ ect about learning to post properly on this forum, but right at the moment I'm pressed for time.
Thank you for your help.