Assuming you are using GDI + and System.Drawing.Graphics
objects to render your graphics (rectangles, circles, etc.) to the surface of the background image (e.g. System.Drawing.Bitmap
Object): members of the System.Drawing.Graphics
object instance System.Drawing.Graphics
that you would need to use is not thread safe . See MSDN documentation here
Given this, I would not use more than one builder stream to render your graphics.
Instead, my recommendation would be to make your entire drawing a System.Drawing.Bitmap
object in the background thread single , rather than in case it is possible. You can use the status bar or other indicator so that the user knows that your program is running in the background.
source share