IASCanvas::GetDC

This method gets a handle to the device context for a control, or creates a compatible off-screen bitmap and gets the device context of that bitmap.

Syntax

HRESULT GetDC( OLE_HANDLE *phdc, BOOL fOffScreen );

Parameters

phdc
Pointer to the handle of a device context (DC).
fOffScreen
[in] Boolean that is set to TRUE to create an offscreen bitmap for the DC, or set to FALSE to get the DC of the control.

Return Values

NOERROR indicates success. E_OUTOFMEMORY indicates that the device is out of memory.

Remarks

Conventional GDI drawing should be done to an offscreen bitmap. When complete, it is then transferred to the screen with either IASCanvas::ClipAndCommit or IASCanvas::Commit. For techniques where the bitmaps already exist, like sprite animation, the offscreen bitmap is not necessary, and should not be created.

See Also

IASCanvas::ClipAndCommit, IASCanvas::Commit