set PictureBox.Image and Timer_tick

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
 
J

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top