Because this lesson makes frequent references to the examples in the book, please read chapter 16 and try the example programs before continuing.
The key to using GDI+ is cooperation. That is, learning to cooperate with GDI+. If you merge your programming smoothly into all the things that GDI+ can do for you, the results are wonderful! If you try to "fight the system" in your code, you'll have real difficulty.
I'm a canoeist and I'm reminded of a motto that I use when I'm shooting rapids in a river:
Ride the river. Don't let the river ride you!
When you're riding a river, that means using the currents and waves to move the canoe where you need it. When you're programming with GDI+, that means using software objects to do all the hard work. To make either of them work, the key is to anticipate what will happen. In programming with GDI+, a lot depends on picking the right event procedure for your graphics code. More on this later.
Or, to pick a different analogy, you might think of GDI+ as a whole factory full of robots, all pre-programmed to do graphical tasks for you. There are the
DrawLine robots and then there are the very specialized DrawBezier robots. Some robots need help from other robots to finish their work.
DrawPolygon can put a square on the screen. You want that square filled with color? You need the
Brush robot then!


