O'Reilly logo

Microsoft® Mobile Development Handbook by Peter Foot, Daniel Moth, Andy Wigley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Reducing Flicker by Using Double Buffering

You may have noticed that even with the relatively simple samples described so far, the screen does not paint all at once. If you use more complex drawing, or you are trying to simulate animation effects by repeatedly repainting an object while moving its position, you will notice a pronounced flickering effect that spoils the results.

The solution to this issue is a technique called double buffering, which simply entails creating a background buffer, drawing to the buffer, and painting the result to the screen only when all drawing is complete. One implementation of double buffering is shown in Example 12-3. (The designer-generated code is not shown; you will have to hook up the Form.Resize event to get ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required