Published by: Apress
Author: Eric White
Introduction:
It is stated in this book that this book is for developers who wish to enhance their programming skills in order to create custom controls. The primary language for this book is C#, this is most likely just a personal preference by the author of the book and it should not really adversely affect any other developer who writes code in other languages. Basically the techniques in this book can be applied by any Visual Basic .Net developer or even an Visual C++ .Net developer. The approach the author chose to take is to first give a brief introduction of what GDI+ actually is and then dive into the nuts and bolts of the underlying framework of GDI+ and then finally go into the architecture and development of Windows custom controls.
It is important to note that the source code for this book is available online at the APress website. You must download the code yourself if you want to see examples the coincide with each chapter of the book.
You can download the source code here:
Chapter 1: .Net Graphics Programming
This chapter provides a good introduction of .Net graphics programming. All the necessary topics are covered for even the most novice programmer. The highlight of this chapter is the overview of the namespaces of GDI+ programming which are listed in the table below.
|
Namespaces |
Description |
|
System.Drawing |
This namespace is where all the basic graphics functionality. This includes the drawing surfaces, images, colors, brushes, pens and fonts. |
|
System.Drawing.Drawing2D |
This is where the raster and vector graphics functionality is located in the GDI+ namespace. |
|
System.Drawing.Imaging |
This is where the advanced imaging functionality is located which is an extension of the System.Drawing namespace. |
|
System.Drawing.Printing |
This is where the printing and print preview functionality of the framework resides. |
|
System.Drawing.Text |
This is where the advanced font functionality is located. |
|
System.Drawing |
This is where the advanced design time support of custom controls. |
An overview of the basic of custom controls is also covered in this chapter quite well.
Chapter 2: Drawing Surfaces
This chapter covers what to consider when drawing to specific target environments. These target environments are a window on a screen (known as a form), a page (sent to a printer) and an image (such as a bitmap) since these all can be drawn to by pixels it is important to note the differences between these drawing surfaces simply because not doing so can affect your program in a very negative manner. I have personal experience debugging a C++ program that had its share of pagination issues and I have to note that many of those issues were most likely caused by the poor translation from one drawing surface to another.
The author does a fairly good job in explaining how to deal with each target environment. However as this is an early chapter some points are purposely left to other chapters to fill in. As there is a complete chapter printing it is wise to reason that the more in depth discussion of that drawing surface would be covered in more detail in that chapter.
Chapter 3: Pens and brushes
This chapter builds on the previous one in that it describes how to actually draw images on the screen using pens and brushes. Pretty much every aspect of the task of using pens and brushes is covered exhaustively in this chapter. Also, when covering this topic the author makes sure you understand how these methods are interacting with the screen, printer, etc to make absolutely sure you take all considerations into effect before setting down and using this namespace.
Chapter 4: Text and fonts
This chapter is perhaps the most drawn out text on fonts and text I have ever seen. Now this is not necessarily a bad thing as without text no information can be conveyed to the end user. Furthermore, the first GUI interface main attraction was the use of the fonts only seen in well published novels and magazines. Again every aspect of the namespaces that control how and where text is laid out on the screen or printer is covered very well in this chapter.
Chapter 5: Images
The use and manipulation of images is covered exhaustively in this chapter. However I would not use this chapter as a sole resource on the subject of image manipulation. Rather I would turn my eye to the open source projects that do the same thing but in an actual application. This would be something like the open source project Paint .Net. You can use this chapter to get a better understanding of what is going on in the underlying code in the project but since the examples are rudimentary and elemental at best it is far better to see this code in an end product such as Paint .Net.
Chapter 6: Graphics Paths and Regions
Now this chapter was interesting as it covered regions which can be used by Windows Forms as a way to create a more customized user interface and hence user experience. Again, an exhaustive coverage of the material is covered. With this understanding hopefully you will have the knowledge to better manipulate the regions and graphic paths in your programs.
Chapter 7: Clipping and Invalidation
Not a whole lot to say about this chapter except that the same exhaustive coverage of the material is continued with this chapter.
Chapter 8: Transformations
Again not a whole lot to say about this chapter except for the same exhaustive coverage of the material is continued again with this chapter.
Chapter 9: Printing
This was a special chapter for me as I worked on a project in my senior year at college that dealt with issues on pagination in a visio like program. Some of the same techniques I employed to debug the program were illustrated in this chapter. Ofcourse I was using MFC at the time and did not have access to the .Net framework but the techniques employed here would apply to many languages.
Chapter 10: An alternative coordinate system
This chapter explains the authors use of his own coordinate system in order to solve issues he found while covering the previous material. Pretty much every method that you expect to see in the .Net 2.0 framework is repeated here but with the author’s own unique twist on things. I am unsure of the real benefits of this coordinate system as there really is no whiz bang examples that really make me believe that this is the way graphics programming should be done. Really this is my biggest complaint of the whole book is that the author does not really develop any really useful program that the reader would want to use in their everyday lives. Personally, I need to see how these coding techniques are put together in a real live program in order to maximize the benefit of the learning experience.
Chapter 11: Architecture and design of Windows Custom Controls.
Finally the meat of the book and it took 11 chapters to get to it! This is really disappointing. Not the content of this chapter by any means but the fact that it took 11 whole chapters to discuss what I believe is the main crux of the work, Windows Custom Controls.
Now while this chapter does employ simple examples to illustrate the point it is trying to convey I would love to see some meatier examples, perhaps in an extended appendix or online on the Apress website.
Chapter 12: Design time support
What is design time support? This is where the end user of your control has the ability to dynamically control the properties of your custom control. Since you are designing for another programmer you must consider all the ways to enhance the experience and increase the development time of the programmer. This chapter does a fine job explaining these techniques and through the simple examples the point is made clear.
Chapter 13: Scrolling
Now when I got to this chapter I thought, why devote an entire chapter to scrolling? After reading the chapter I was still left with that question. In the very beginning of the chapter the author explains that there is considerable amount of built in support in Windows Forms for scrolling. So why would you want to do it yourself since it has already been done? While this chapter does an excellent job of explaining how to implement this in your own custom controls I can only justify this chapter as a filler chapter.
Chapter 14: Mouse event and cursors
What is a graphical user interface without the mouse? Not much in my book. This chapter explains how to properly utilize this input device as it pertains to your custom control. Since this is the last chapter of the book I was expecting some sort of wrap up, however there was none. No really great words of wisdom from someone who develops custom controls on a daily basis, none of that. Somewhat disappointed.
Overall impression of the book
Now admittedly I am not a great graphics programmer by any means. However this book will certainly teach you the nuts and bolts of GDI+ programming. How that will benefit you is up to your own judgment.
Where this book needs improvement on is that fact that there is not one single project the reader can build upon in order to learn the concepts taught in this book. Also when the reader does get to the meat of the book the content is left hanging by excruciating examples that most readers will be able to find by doing a simple
Pro .NET 2.0 Graphics Programming