Load large image after unloading a large image

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When trying to load a large image on a Pocket PC 2003, after Disposing a large
image and also after using GC.Collect(), I get an exception with "Exception"
as the
message, no other information, and it's not an OutofMemory Exception. I did
not have this problem on Pocket PC 2002 eventhough it had less memory.


//Scenario 1
Image img;
img = Bitmap.FromFile("file1.jpg");
//show the image
img.Dispose();
GC.Collect();
//the next line causes an exception with message "Exception"
img = Bitmap.FromFile("file2.jpg");


//Scenario 2
Image img;
img = Bitmap.FromFile("file2.jpg");
//show the image
img.Dispose();
GC.Collect();
//the next line causes an exception
img = Bitmap.FromFile("file1.jpg");


Any idea what I can do ?

thank you

awni
 
What are you using to display images? And what the size (width and
height) of file1.jpg, file2.jpg.
 
i'm using standard picturebox. the width/height of the images vary. but like
i said,
the file1 is displayed IF it is opened first the same with file2.

awni
 
Back
Top