The book
contains a total of 13 chapters and 1 Appendix. Chapter 1 explains in detail
how to build a custom control with a well crafted example. All examples have
been worked out using C#. This chapter will serve as a reference for all
upcoming chapters since the basic principles of building a custom control have
been dealt in this chapter.
The next two
chapters touch the basics of GDI+ such as painting in a form using
control.paint event, invalidation, using Color object, Pen object, Brush object,
etc. Apart from explaining the basics of GDI+, authors have added extra steps
to explain how to improve the quality of drawing using the AntiAliasing
technique.
Chapter four is
all about drawing shapes. This includes a perfect example which narrates how to
draw the Visual Studio Logo. Translation, Rotation and Scaling are the other
three major topics which are covered in this chapter. To explain the
translation, rotation and scaling, an example to create a clock is discussed at
the end of this chapter.
The fifth
chapter talks about building custom button controls, checkboxes, radio buttons,
scroll buttons, etc. There could be cases where some of the controls share some
common behaviors. Creating a base class for two or more controls is explained
neatly with examples.
Chapter 6 is entitled,
“Working with Images.” The total chapter is only 14 pages. Creating image thumb
nails is a commonly used module in most of the websites. This chapter talks
about scaling the image, but the examples provided were not very great. This is
a disappointment. It would have been nice if more examples appeared in this
chapter.
Chapter seven
deals with Printing. You might wonder why we would want to write code to print
since printing functionality is built into windows. In many cases, we would
want to allow the user to print the contents of custom control that we built.
For that purpose, we will have to write our own code to print. This chapter
takes us into the common coding aspects that we need to follow to print custom
controls.
Chapter 8
narrates about .NET collections. After explaining about some common collections
available in .NET framework, the authors have given us a nice example about how
to create a “Font Picker” control. Using collections in a custom control may be
a necessity if we want to store dynamic data.
GDI+ consumes a
lot of resource (memory). In order to improve the performance of application
which uses GDI+ techniques, many techniques are available. One such technique
is known as “Double Buffering.” Chapter 9 is all about “Double Buffering.” The
concept is explained nicely with an example.
If you want to
allow users to drag and drop controls inside your application, then we should
have a nice set of code which handles the Mouse Events. Chapter 10 discusses
how to add the drag and drop functionality to a custom control with working
examples.
Chapters 11 and
12 are just icing on the cake. Design – Time support is explained a little in
chapter eleven and in chapter twelve, designing nice user interfaces are
discussed. Both chapters lack in-depth analysis.
The last chapter
is kind of a mini project. Authors have explained in detail how to create a
PieChart control. Simply put, this chapter uses everything that is being
discussed in the earlier chapters. This chapter will provide you with the building
block for developing our future controls.
To sum up the
review, this book is for those who want to build custom control using GDI+.
After reading this book, the reader will get enough information regarding how
to build a quality functional custom control from scratch.