11.7. Printing Graphics

We just saw how to print text files. Now let’s talk about how to print images and graphics items such as lines, rectangles, and ellipses. You probably have a pretty good idea how printing works. It’s all in the magic of the Graphics object available through PrintPageEventArgs. Once we have a printer’s Graphics object, we call draw and fill methods to print graphics items. In this section we will create an application that shows how to print simple graphics objects, including lines, curves, rectangles, and images.

Again, we create a Windows application and add a main menu to the form. We add four menu items to the main menu. The final form looks like Figure 11.13. As you might guess, the Draw Items and View Image menu ...

Get Graphics Programming with GDI+ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.