11.1. The graphics device interface

Programmers experienced with Windows development should be familiar with the concept of the graphics device interface (GDI). It is part of Windows OS and provides functions and structures to generate graphical output for such devices as screens and printers. The GDI contains functions to draw lines, curves, closed figures, paths, text, and bitmaps. To specify colors and styles when drawing, the GDI provides pens, brushes, and fonts. Pens are used to draw lines and curves, brushes to fill the inner spaces of closed figures such as rectangles and ellipses, while fonts are used to write text, naturally.

To be able to utilize graphics, programs should obtain a device context for the particular device used, whether ...

Get A Programmer's Guide to .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.