I'm currently programming a Program which displays all pictures of a folder after another, but although I use dispose before I load the new Image, I get the OutOfMemory exception after a few picture. My Task Manager shows nearly constant RAM usage so there shouldn't be a Memory Leak...
private void loadImage()
{
if (pictureBox1.Image != null)
{
pictureBox1.Image.Dispose();
}
pictureBox1.Image = Image.FromFile(filenames[index]);
}