2.1 Device-Context Functions

Device-context functions create, delete, and restore device contexts (DC). A device context is a link between a Windows application, a device driver, and an output device, such as a printer or plotter.

Figure 2.1 shows the flow of information from a Windows application through a device context and a device driver to an output device:

Any Windows application can use GDI functions to access an output device. GDI passes calls (which are device independent) from the application to the device driver. The device driver then translates the calls into device-dependent operations.

The following list briefly describes each device-context function:

Function Description  
CreateCompatibleDC Creates a memory device context.  
CreateDC Creates a device context.  
CreateIC Creates an information context.  
DeleteDC Deletes a device context.  
GetDCOrg Retrieves the origin of a specified device context.  
RestoreDC Restores a device context.  
SaveDC Saves the current state of the device context.