Nick Symmonds delivers his second .NET offering this year with GDI+ Programming in C# and VB.NET. Following up on his successful Internationalization and Localization Using Microsoft .NET, Nick brings us another insightful tome filled with useful examples and occasional witty entertainment.
- Symmonds provides a structured analysis of the GDI+ object model and offers practical examples of how to use the product.
- The indexing and headlining may occasionally distract you from finding the information needed.
Introducing .NET the right way
Every .NET book out there has a chapter titled “.NET Primer,” or something similar. However, this book actually introduces those parts of programming for .NET that matter to graphics programmers. Your average ASP.NET developer knows how to create an event delegate in C# and VB.NET, but Symmonds covers that in detail because it is important to the graphics portion of the book.
Method overloading also falls into this category. Not only will graphics programmers overload a lot of methods in their own classes, but Microsoft uses massive amounts of overloading in the GDI+ classes. Understanding the principles under C# and VB.NET offers an important piece of the puzzle.
Breaking down the code
As an author, I understand the difficulty of trying to explain code without being in front of the reader to answer questions. Symmonds structures the book in such a way as to make the code samples understandable. For example, when the lesson being taught requires only one line of example code, he gives only one—in both VB.NET and C#. When necessary, a detailed example is provided and is available for downloading.
I ran the majority of the sample code and had no problems. I think some readers ran into problems trying to run the sample code against the Beta 2 CLR, which doesn’t work for obvious reasons. To this point, I have not found a single error in the code and only two actual errors in the text.
Another interesting feature of this book is the complete GDI sample project in VB6 and C++. This fishbowl example takes the reader through the methods for writing graphics code using the various tools in Visual Studio 6, including such constructive practices as creating a memory leak. Really!
On the downside
There are a few downers. The book depends too much on Visual Studio .NET, in my opinion. Often in examples, Symmonds illustrates a point by having us modify code in the Windows Form Designer-generated code. Although there is nothing wrong with this, I just feel it is bad form and a black mark on an otherwise stellar example of how to program correctly the first time.
As I mentioned above, the indexing and headlining suffer as well. I couldn’t find a reference to the Pen.Color property anywhere in the index, but two pages of entries appear generically under C# and largely the same references are listed under VB.NET. For a book of this complexity, a 21-page, widely spaced index just doesn’t cut it.
Real-life examples are a definite plus
After an exhaustive look at the GDI+ object model, including vector and raster images, advanced techniques, text, and printing, Symmonds takes us on a tour of a graphics programmer studio in real life. His screen capture example does a great job of illustrating how to employ the power of GDI+, and the custom form designer takes the concept of the sample application to new heights. It doesn’t win the prize for the greatest sample app in a book, but it sure comes close.
To meet my standard as a helpful case study, a project must illustrate a useful point and have lots of sample code to play around with. The custom form example rates favorably in both categories. The concept of the application—converting a vector path into a form—is remarkable in and of itself. And with well over 600 lines of example code in just the main screen—all very well formed, I might add—it is a feast for anyone trying to manipulate forms in their Windows applications.
Worth adding to your bookshelf
Frankly, this book isn’t for everybody. If you need to crop an image on the fly or put some lines on a form, you can probably find sample code on the Web. However, if you need to write graphic-intensive applications, create custom controls, or handle image manipulation, buy this book. Symmonds’ obvious experience in both graphics and real-world application design comes through in a big way, making this title a sure bet for anyone doing GDI+ application design.