Chapter 18. User Interface

A picture is worth a thousand words—or several thousand lines of source code, if you’re generating a bitmap image of it. Writing code to manipulate images of varying color depths, or to trace out multilayer vector art, can be a nightmare of geometric contortions and linear algebra. It makes one yearn for those days of prescreen computers. The first programming class I took used a DECWriter, a printer-based terminal that had no screen, and included the graphics capabilities of a jellyfish. It was perfect for me. I couldn’t draw a straight line anyway, and I didn’t need some fancy schmancy “video display terminal” reminding me of it.

The graphics included in early display systems weren’t much better. “Dumb terminals,” such as the popular VT100, included some simple character graphics that displayed basic lines and blocks. Each graphic part was exactly one character in size, and any images you sought to display had to fit in a clunky 80 × 24 grid.

Fortunately for art aficionados everywhere, computers have come a long way in the graphics department. GDI+, the standard .NET drawing system, includes complex drawing features that would make a DECWriter cry. Built upon the older Windows “Graphics Device Interface” (GDI) technology, GDI+ includes commands for drawing lines, text, and images in the Picasso-enhanced world of 2D graphics.

Beyond GDI+, .NET also provides support for the newer Windows Presentation Foundation (WPF), a rich user interface and multimedia ...

Get Programming Visual Basic 2008 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.