set PictureBox.Image and Timer_tick

  • Thread starter Thread starter juvi
  • Start date Start date
J

juvi

Hello,

I am running out of memory. How can I fix this:

//image for pictureBox
Image BGImage;

I load the image first into BGImage when loading main Form:

BGImage = new Bitmap(path + @"\img\bg_default.png");

I am drawing different things onto the picturebox and I need the set back
the image to default every timer tick. I use this for the tick event but this
is going out of memory:

pb_BG.Image = new Bitmap(BGImage);

//draw now something
....

pb_BG.Invalidate();

thx for any help
juvi
 
thank you very much...this worked perfect...

I still want to know for test purposes how much memory is consumed by the
program...is there a way to get the current memory consumption from my
process.

thx
 
Back
Top