Optimising Draw methods

Use DrawDeferred() rather than DrawNow()

DrawNow() results in a direct call to a control's Draw method. DrawDeferred() results in the windows server invalidating a control's drawing area (so the Draw() will still get called) but also buffering the calls. It then filters repeated calls and only calls the Draw methods that are really needed. Once.

The upshot is that to make gains in drawing performance, you're better off (somewhat paradoxically) calling DrawDeferred() rather than DrawNow().
Bear this in mind when working with code, and if possible spend a few minutes converting to DrawDeferred(). You'll need to check the results (in some cases you might well need the immediate update that DrawNow() provides) but if you see no update problems go with the DrawDeferred() - it'll make a big difference on hardware.

Use the aRect parameter that's passed into your control's Draw method

It's the windows server helping you out by telling you which area needs redrawing. So don't ignore it and blit the whole control "just to be on the safe side".

Sometimes the overhead of calculating how to draw a sub-region is more than the speed gained by reducing the draw area, but on the whole the aRect is useful - so use it (and pass it on to sub-controls).
The BitBlt commands are even overloaded to accept a position and clipping rect so there's no excuse:

<-- gc.BitBlt(TPoint(0,0), background);
--> gc.BitBlt(aRect.iTl, background, aRect);

Don't use Window().SetBackgroundColor()

If you call this method with a colour parameter, the windows server will do a default background wipe for you. The problem is that this will often occur a long time before your Draw method gets called so in the meantime the draw area will just be sitting there filled with the colour specified (usually white). This is often the cause of the white flashes seen in many applications and areas of the OS.

Instead, remove the call to SetBackgroundColor(). If you see any transparency problems you can always add a wipe to the start of your Draw method (to ensure that all drawing occurs at the same time).

Check how often your Draw method is being called

Put a breakpoint in and check to see that your Draw method isn't being called more than is needed. If it is, identify the callers and remove the redundant code.

Note that when debugging drawing code on the emulators you can force the windows server to flush each call by pressing CTRL+ALT+SHIFT+F.
Press CTRL+ALT+SHIFT+G to return to normal mode.