Quantcast
Channel: magick Discussions Rss Feed
Viewing all articles
Browse latest Browse all 3693

New Post: StackOverflowException

$
0
0
this code
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.

Viewing all articles
Browse latest Browse all 3693

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>