Many friends often do a drawing program, often appear on the screen, not refreshing, a problem, telling you a solution, buffering the drawing. If someone is using a refuse to solve this problem, then it is easy to appear in the line, the effect is not very good. If it is a big picture, then the buffer drawing is a good way to solve.
Search online, or buffer drawings, there will be many technical articles, but they are both vc or java, very few code examples of Pascal. However, the principle is the same, you can refer to their articles. I will put the article on the last reprinted VC buffer drawing. :) Thanks for the original author.
Delphi is more convenient.
Oldbmp, bufbmp is Tbitmap
// Draw method:
Procedure tchart.draw (acanvas: tcanvas);
Begin
{Put the action you want to draw here}
END;
On the place you want to draw, put the best content in memory in the Canvas you want to display, here is Canvas:
Draw (bufbmp.canvas); // DRAW method is the above code
Bitblt (Self.canvas.Handle, 0, 0, ClientWidth, ClientHeight,
Self.buffmp.canvas.handle, 0, 0, srcopy; // copy function
If you want to use multiple buffers, use bufbmp.assign (oldbmp); do more image content in memory, then further action in BUFBMP, and attach it to the display area.
Simple :).
How to draw in memory buffer