It must be said that code optimization skill and knowledge of performance techniques are best acquired from the shared experiences of other developers. With the ever expanding capabilities of Internet communication, the best resources are online forums, newsgroups, and sites dedicated to code sharing. A recommended resource for topics covered in this chapter (and indeed throughout this book) is the C# Corner site (http://www.c-sharpcorner.com).
Let's start with an introduction of the basic architecture of drawing (rendering or painting) within Windows Forms using GDI+. By the end of this chapter, you will be armed with GDI+ tips and tricks that make a significant difference in the efficiency of many performance-oriented graphics applications. Note, however, that these tips and tricks may not be applicable for Web applications.
Here are the topics that we will discuss in this chapter:
GDI+: The Next-Generation Graphics Interface
Your First GDI+ Application
The Graphics Class
Working with Brushes and Pens
Colors, Fonts, and Text
Rectangles and Regions
Working with Images
Advanced Imaging
Advanced 2D Graphics
Transformation
Printing
Developing GDI+ Web Applications
GDI+ Best Practices and Performance Techniques
GDI Interoperability
Miscellaneous GDI+ Examples
Appendix A. Exception Handling in .NET