Copyright © 1998-2015 MultiMedia Soft

How to perform custom graphic rendering over the control surface

Previous pageReturn to chapter overviewNext page

At runtime you have the possibility to add your own custom graphic rendering over the control surface in two ways:

catching the PaintDone event and using the passed Device Context: this event is generated as soon as the rendering of a certain control has been completed; using this technique is generally faster but, due to the fact that the passed Device Context is the screen Device Context, it won't be flicker free.
using the SetCustomPaintFunction method and providing your own drawing function(s): this technique is a little bit slower because the rendering is performed using double-buffering but the final result will be certainly better because it will be completely flicker free.

It's up to you deciding which of these techniques will better fit your needs.

Note that you have the possibility to use both of them at the same time but it's important to remember that the function provided through the call to the SetCustomPaintFunction method will be called before the generation of the PaintDone event.