
466
LESSON 41 Printing with wPF
Figure 41-4 shows the result. Notice that the Window’s image is centered and enlarged to fill most of
the printable area.
FIGURE 414
In addition to the PrintVisual method, the PrintDialog class provides a PrintDocument method
that prints multipage output or document objects such as
FlowDocuments or FixedDocuments.
Unfortunately these topics are fairly complex, so they’re not described here. If you need those capa-
bilities, you can find more information online at:
PrintDocument
— msdn.microsoft.com/library/system.windows.controls
.printdialog.printdocument.aspx
FixedDocument
— msdn.microsoft.com/library/system.windows.documents
.fixeddocument.aspx
FlowDocument
— msdn.microsoft.com/library/system.windows.documents
.flowdocument.aspx
TRY IT
In this Try It, you modify the example programs described in this lesson to print an image of a
window rotated sideways so it fills even more of the printed page. Figure 41-5 shows the result.
You can download the code and resources for this Try It from the book’s web
page at
www.wrox.com or www.CSharpHelper.com/24hour.html. You can find
them in the Lesson41 folder of the download.
596906c41.indd 466 4/7/10 12:35:26 PM