About Device Contexts

Device contexts link presentation spaces to devices by converting device-independent presentation space information into device-dependent information. This conversion occurs in the presentation driver, a low-level program that is transparent to the application. A presentation driver is device-driver code that converts the application commands into output commands specific for each output device.

After creating a device context, it must be associated with a presentation space before the drawing (or primitives) can be printed or displayed. When a presentation space and a device context are associated with each other, any output you direct to the presentation space is directed automatically at the device context and displayed on the physical device. For example, before you can draw a picture in a display window, the picture's graphics presentation space must be associated with the window's device context.

Device contexts also give applications access to important device information such as screen dimensions or printer capabilities.

As with presentation spaces, there are three types of device contexts:


[Back: Presentation Spaces Review]
[Next: Cached Device Contexts]