This document is archived and information here might be outdated.  Recommended version.

IScreenDisplay.AddCache Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Display > ESRI.ArcGIS.Display > Interfaces > IS > IScreenDisplay Interface > IScreenDisplay.AddCache Method
ArcGIS Developer Help

IScreenDisplay.AddCache Method

Creates a new cache and return its ID. The ID can be specified to StartDrawing to direct output to the cache. It can also be used with a number of other methods such as DrawCache and Invalidate.

[Visual Basic .NET]
Public Function AddCache ( _
) As Short
public short AddCache (

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.


ScreenDisplay objects make it possible for clients to create any number of caches.  A cache is an off screen bitmap representing the application's window.  Instead of drawing directly to the screen, graphics are drawn into caches, then the caches are drawn on the screen.  When the application's window is obscured and requires redrawing, it done so from the caches instead of from a database.  In this way, caches improve drawing performance - bitmap rendering is faster than reading and displaying data from a database.

In general, a Map object creates three caches: one for all the layers, another if there are annotation or graphics, and a third cache if there is a feature selection.  A layer can create its own private cache if it sets ILayer::Cached equal to TRUE.  In this case, the Map will create a separate cache for the layer and groups the layers above and below it into different caches.

The AppDisplay object has no implementation for this method.

See Also

IScreenDisplay Interface