SaveDC function

The SaveDC function saves the current state of the specified device context (DC) by copying data describing selected objects and graphic modes (such as the bitmap, brush, palette, font, pen, region, drawing mode, and mapping mode) to a context stack.

Syntax

int SaveDC(
  HDC hdc
);

Parameters

hdc

A handle to the DC whose state is to be saved.

Return Value

If the function succeeds, the return value identifies the saved state.

If the function fails, the return value is zero.

Remarks

The SaveDC function can be used any number of times to save any number of instances of the DC state.

A saved state can be restored by using the RestoreDC function.

Requirements

   
Windows version Windows 2000 Professional [desktop apps only] Windows 2000 Server [desktop apps only]
Target Platform Windows
Header wingdi.h (include Windows.h)
Library Gdi32.lib
DLL Gdi32.dll

See Also

Device Context Functions

Device Contexts Overview

RestoreDC