![]() |
|
QA: How to implement offscreen buffer?
By Vassili Philippov, July 07, 2001.
QuestionI 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? AnswerYou 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. Source codeThe following code gives example of an offscreen buffer using STScreenBuffer library. The following code gives example of an offscreen buffer using MFC functions. DiscussDiscuss this article. Here you can write your comments and read comments of other developers. |
|||||||||||||||||||||