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


IScreenDisplay.StartRecording Method (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (Display)  

IScreenDisplay.StartRecording Method

Starts recording all output to the recording cache.

[Visual Basic .NET]
Public Sub StartRecording ( _
)
[C#]
public void StartRecording (
);
[C++]
HRESULT StartRecording(
void
);

Product Availability

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

Remarks

In addition to the caches clients create, the ScreenDisplay object also provides a recording cache that accumulates all drawing that happens on the display.  This recording cache is used to redraw the application when the application is moved or exposed or when drawing rubber banding.

Note, StartRecording and StopRecording are exposed for developers creating custom applications that draw from multiple caches and need to refresh quickly.  If you are working with ArcMap or even the Map object, leave all cache management up to the Map.

Use StartRecording to let the display know exactly what to record.  Use DrawCache(esriScreenRecording) to display the recording cache.  Use CacheMemDC(esriScreenRecording) to get a handle to the memory device context for the recording bitmap.

The following C++ code excerpt is a drawing sequence example that uses StartRecording.

VARIANT_BOOL isCacheDirty;
m_ipScreen->IsCacheDirty(esriScreenRecording, &isCacheDirty);

if (isCacheDirty) // draw from scratch
{
  m_ipScreen->StartRecording();
  m_ipScreen->StartDrawing((OLE_HANDLE)hPaintDC, esriNoScreenCache);
  DrawContents();
  m_ipScreen->FinishDrawing();
  m_ipScreen->StopRecording();
}
  else // draw from offscreen bitmap
{
  m_ipScreen->DrawCache((OLE_HANDLE)hPaintDC, esriScreenRecording, 0, 0);
}

See Also

IScreenDisplay Interface