I had to publish my decision a long time ago ...
Well, here is my solution:
Bitmap buffer = new Bitmap(screenWidth, screenHeight);//set the size of the image System.Drawing.Graphics gfx = Graphics.FromImage(buffer);//set the graphics to draw on the image drawStuffWithGraphicsObject(gfx);//draw pictureBox1.Image = buffer;//set the PictureBox image to be the buffer
It makes me feel like a complete idiot to find this solution years after I asked this question.
I tried this with Panel, but when applying a new image, it turned out to be slower. Somewhere I read that it is better to use Panel instead of PictureBox. I donβt know if I need to add something to the code to speed up the panel.
source share