Knowledge Base Article
KB10587 - CachedPaint mode functionality
The Developer Kernel Cached Paint option is designed to eliminate screen flickering durng the map rendering process. The map is first rendered as an internal bitmap and then presented as one step, instead of rendering the vectors individually. But the order of operations required to allow for map updates, the elimination of refreshing when the window is hidden by other windows, fast display of GPS tracking, etc. can be a bit complicated:
Windows output TGIS_Viewer.CachedPaint=True
- 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 fancy styles will not be represented.
- Bring up the cache to the screen
- Draw from cache all layers except the top-most layers marked as CachedPaint=False
This results in the drawing of the entire map except for a non cachable GPS tracking layer(s), which can be drawn on screen directly (as an in-memory layer)
- Bring up the cache to the screen
- 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 hidnig a part of a window), the code starts from (4).
Windows output TGIS_Viewer.CachedPaint=False
- 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 fancy styles will not be represented.
- Draw in the window all layers
When dragging a map, all code starts from (1); When zooming, updating, etc., code starts from (2).
Any other device
- Draw on all layers:
Additional comments
- You can turn on/off TGIS_LayerVector.FullPaint. When FullPaint=False, only a minimal redraw is performed on a map move event. For example, after dragging the screen will be scrolled and only the previously non-visible areas will be drawn. Generally this is faster, but Labels cannot be rendered in 'follow the road' mannor because the label positions cannot be optimized for entire window.
- You can specify the state of the paint process by checking the:
- TGIS_Viewer.DrawMode
- gisDrawAll - all layers will be drawn
- gisDrawAllExceptTop - all layers except the topmost should be drawn
- gisDrawTop - only the top-most layers should be drawn
- TGIS_Viewer.InIncrementalPaint
- If true - an incremental paint is performed
- TGIS_Viewer.InDirectPaint
- If false - the map is simply restored form cache.
Created: 2005-09-14, Modified: 2010-11-15
|