Vassili Philippov (vasja@spbteam.com), July 07, 2001.
I need to output function graphic. When I draw the graphic using GDI function I see flicker. I want to create an offscreen buffer to prevent this flicker. How can I do that?
You have to create a bitmap as a buffer. Then create memory device context and select this bitmap into the device context. Then draw into this memory context and then copy the memory device context into the target device context using BitBlt function.
Or you can use STScreenBuffer library that encapsulates most of this work and make implementation of a screen buffer simpler. More over CSTScreenBuffer class gives you fast access to points that could not be done using GDI functions.
The following code gives example of an offscreen buffer using STScreenBuffer library.
The following code gives example of an offscreen buffer using MFC functions.