ArcObjects Library Reference (Display)  

IScreenDisplay.Invalidate Method

Cause the specified area of the specified cache to redraw.

[Visual Basic .NET]
Public Sub Invalidate ( _
    ByVal rect As IEnvelope, _
    ByVal erase As Boolean, _
    ByVal cacheIndex As Short _
)
[C#]
public void Invalidate (
    IEnvelope rect,
    bool erase,
    short cacheIndex
);
[C++]
HRESULT Invalidate(
  IEnvelope* rect,
  VARIANT_BOOL erase,
  short cacheIndex
);
[C++]

Parameters

rect [in]

  rect is a parameter of type IEnvelope

erase [in]   erase is a parameter of type VARIANT_BOOL cacheIndex [in]   cacheIndex is a parameter of type short

Product Availability

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

Remarks

Use Invalidate to refresh a specific region on the display.  For example, if you add a new feature, only the extent of the new feature requires refreshing; the remainder of the display can redraw from cache.

The rect parameter specifies the region to update.  Use 'Nothing' in Visual Basic or a zero in C++ to invalidate the entire display.

Erase specifies whether or not the background within the update region is erased when the update region is processed.  Usually this is set to TRUE.

CacheIndex controls which cache to update.  Use IActiveView::ScreenCacheID to get the cache index for a specific draw phase.  The valid draw phases are held in the esriViewDrawPhase enumeration and are as follows:

0 - esriViewNone
1 - esriViewBackground
2 - esriViewGeography
4 - esriViewGeoSelection
8 - esriViewGraphics
16 - esriViewGraphicSelection
32 - esriviewForeground

You can also specify esriAllScreenCaches, esriNoScreenCache, and esriScreenRecording.

Invalidate sets the cache(s) as dirty.  Use IsCacheDirty to check the state of a particular cache.

After completion, Invalidate fires the IDisplayEvents::DisplayInvalidated event.

 

IActiveView::PartialRefresh has similar parameters and itself calls Invalidate. Use this method instead as much as possible as it automatically determines the cache index based on the phase provided.

 

 

See Also

IScreenDisplay Interface | IActiveView.ScreenCacheID Property | esriViewDrawPhase Constants | IActiveView.Refresh Method | IActiveView.PartialRefresh Method | IScreenDisplay.Invalidate Method