This document is archived and information here might be outdated. Recommended version. |
ArcObjects namespaces > Display > ESRI.ArcGIS.Display > Interfaces > ID > IDisplay Interface > IDisplay.hDC Property (ArcObjects .NET 10.4 SDK) |
The device context that the display is currently drawing to. Only valid between calls to StartDrawing and FinishDrawing.
[Visual Basic .NET] Public ReadOnly Property hDC As Integer
[C#] public int hDC {get;}
[C++]
HRESULT get_hDC(
long* hDC
);
[C++]
Parameters hDC [out, retval] hDC is a parameter of type long
Returns the device context specified to StartDrawing. This may be the device context of a display, cache (bitmap), or some other device such as a printer. As StartDrawing is called frequently throughout the drawing pipeline, the hDc property continually changes and is therefore safe to use only within a single StartDrawing / FinishDrawing block.
This property does not provide a value to pass to IDisplay::StartDrawing. Instead, call IDisplay::StartDrawing with a value of 0 for the hDC as this will automatically use the Windows API function GetDC to populate IScreenDisplay::WindowDC with the hDC of the main display and drawing will occur there.