this code
What do you mean under "Is it possible that there is a memory issue?" . The process uses 35mb before and 87 mb after it crush.
"This creates a copy of the bitmap and you are not disposing the other image.'
Bitmap bm = new Bitmap(image.ToBitmap());
pictureBox.Image = bm;
it is equal to
pictureBox.Image = new Bitmap(image.ToBitmap());
If I dispose bm, the pictureBox will be clear. I do
pictureBox.Image = null;
GC.Collect();
before this to dispose the previous image.
Bitmap bm = (Bitmap )pictureBox.Image;
pictureBox.Image = image.ToBitmap();
if (bm != null)
bm.Dispose();
does not helps. What do you mean under "Is it possible that there is a memory issue?" . The process uses 35mb before and 87 mb after it crush.
"This creates a copy of the bitmap and you are not disposing the other image.'
Bitmap bm = new Bitmap(image.ToBitmap());
pictureBox.Image = bm;
it is equal to
pictureBox.Image = new Bitmap(image.ToBitmap());
If I dispose bm, the pictureBox will be clear. I do
pictureBox.Image = null;
GC.Collect();
before this to dispose the previous image.