OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
Working with Device Contexts

When working with the Windows GDI, you use a device context to access all devices, from windows to printers to plotters.

The device context is a structure maintained by GDI that contains essential information about the device with which you are working, such as the default foreground and background colors, font, palette, and so on. ObjectWindows encapsulates device-context information in a number of DC classes, all of which are based on the TDC class.

TDC contains most of the device-context functionality you might require. The other DC-related classes are derived from TDC or TDC-derived classes. These derived classes only specialize the functionality of the TDC class and apply it to a discrete set of operations. Here is a description of each of the device-context classes:

  • TDC is the root class for all GDI device contexts for ObjectWindows; it can be instantiated itself or specialized subclasses can be used to get specific behavior.
  • TWindowDC provides access to the entire area owned by a window; this is the base for any DC class that releases its handle when done.
  • TScreenDC provides direct access to the screen bitmap using a device context for window handle 0, which is for the whole screen with no clipping.
  • TDesktopDC provides access to the desktop window's client area, which is the screen behind all other windows.
  • TClientDC provides access to the client area owned by a window.
  • TPaintDC wraps BeginPaint and EndPaint calls for use in an WM_PAINT response function.
  • TMetaFileDC provides a device context with a metafile loaded for use.
  • TCreatedDC lets you create a device context for a specified device.
  • TIC lets you create an information context for a specified device.
  • TMemoryDC provides access to a memory device context.
  • TDibDC provides access to DIBs using the DIB.DRV driver.
  • TPrintDC provides access to a printer device context.

See Also