Knowledge Base



KB10587 - Explanation of the CachedPaint feature.

The CachedPaint feature is designed to improve map rendering by eliminating screen flicker on map move events (scrolling, zooming, selection, etc.). CachedPaint turned ON eliminates screen flicker by generating the map (or specified layers) first to an internal bitmap image which is then presented in one step.

With CachedPaint turned OFF, the progress of repainting the map is visible (vector by vector if the computer is slow) upon each map move event, after both the first and the second buffer operations of the TatukGIS IncrementalPaint process (refer to KB10540). Therefore, the CachedPaint feature can particularly improve the map rendering experience in computationally demanding situations involving very large vector data sets, presentation of many labels or charts, and/or a slow computer.

CachedPaint mode can be set at the map (or application) level and at the individual layer level. This allows the possibility to turn CachedPaint OFF for only one layer (or a group of layers), but not for other layers in a map project. This is useful, for example, if one layer is used as an in-memory animation layer for dynamic presentation of GPS tracked moving object(s). Because map drawing always starts from the bottom-most layer and finishes with the top-most layer, the CachedPaint OFF layer (or layers) must be the top-most layer(s). A layer CachedPaint OFF setting will have no effect if the layer is below any other layer for which CachedPaint is turned ON.

The order of operations required for proper map updates, elimination of refreshing when a window is hidden by other windows, fast display of GPS tracking, etc., can be a bit complicated:

  • Windows output TGIS_Viewer.CachedPaint=True
  1. Draw from cache all layers marked as IncrementalPaint=True.
    This results in a first draw only 'skeleton' map of the main roads (only if TGIS_LayerVector.IncrementalPaint=True). Labels and complicated styles will not be represented.
  2. Bring up the cache to the screen.
  3. Draw from cache all layers except the top-most layers marked as CachedPaint=False.
    This results in the drawing the entire map except for any non cachable GPS tracking layer(s), which can be drawn on screen directly (as an in-memory layer).
  4. Bring up the cache to the screen.
  5. Draw on screen the top-most layers marked as CachedPaint=False.

When dragging a map, all code starts from (1); When zooming, updating, etc., the code starts from (3); When the windows area becomes unhidden (the windows area is in the top-most position or a windows/dialog box is closed which had been hiding a part of a window), the code starts from (4).

 

  • Screen output TGIS_Viewer.CachedPaint=False
  1. Draw on windows all layers marked as IncrementalPaint=True.
    This results in a first draw only 'skeleton' map of the main roads (only if TGIS_LayerVector.IncrementalPaint=True). Labels and complicated styles will not be represented.
  2. Draw in the window all layers.
When dragging a map, all code starts from (1); When zooming, updating, etc., code starts from (2).
  • On any device other then screen output CechPaint is not significant
Created: September 14, 2005, Modified: August 07, 2013