Sooner or later you will need to print out application data. Perhaps you have created documents or test data and now you want to see them on paper. You may be drawing something and want to print it out. Printing data from a database and printing images are other possibilities. With the .NET Framework you will find it easy to create applications that talk your printer's language. This chapter covers printing functionality in the .NET Framework. The aim is to give you the knowledge to handle basic (and some not so basic) printing needs.
We'll begin with a brief history of printing, followed by an introduction to the printing classes available in .NET. Toward the end of the chapter we will delve deep into printing functionality. After reading this chapter, you should have a good idea of printing functionality defined in the .NET Framework, and how to implement this functionality in your applications. Here are some of the topics 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