Chapter 7

Painting Pictures

There’s a Visual Basic Way of painting pictures, and there’s a Windows Way. The Basic Way is simple and limited. The Windows Way is complicated and powerful. The trick is to make the unlimited Windows Way look like the easy Basic Way. To do this, you have to understand both ways inside and out. And you have to understand a third way that, for lack of a better term, I call the Real Way of painting pictures.

In real life, people create pictures by daubing paint onto canvas, pushing pencil across paper, scraping chalk on blackboard, scribbling crayons in coloring books, molding clay into shapes, even gluing other pictures onto cardboard. Computers can’t do any of that. The computer world offers only one way to get a picture onto the screen, and that is pixel by pixel.

Georges Seurat constructed his pictures from tiny bits of paint, but you can be sure that even he wouldn’t have tried to paint Bathers on a computer screen pixel by pixel. Nevertheless, that’s how it would have come out on his screen.

Programming graphics is the art of modeling the different ways of creating real pictures so that they come out on the screen or from the printer in the form of pixels. (Don’t confuse the issue with exceptions such as plotters.) This chapter discusses both the Windows Way and the Basic Way of drawing and painting pixels and how to mix the two approaches.