Wednesday, November 4, 2009

17.5 Summary




< BACK  NEXT >

[oR]

17.5
SUMMARY


In this chapter the topics we have discussed so far in this book�device context, lines and curves, area fill, bitmap, font, text, and EMF�all come together, because now we want printing. We've discussed spooler architecture, printing process, spooler API to query about printers and set up printers, GDI printing support functions, and�most importantly�how to use Win32 API support to implement professional printing features in your application. In Section 17.3, a generic displaying and printing class KSurface was developed. It supports truly WYSIWYG presentation of graphics data using a uniform logical coordinate system. Section 17.4 gives two nontrivial sample programs which use the KSurface class and KPageCanvas class to solve real-world problems: source-code printing and JPEG image printing.



With printing fully taken care of, we're finishing the traditional GDI part of the Windows graphics programming. But, like any technology, GDI is still developing, and clearly it's moving to a more colorful, high-performance world with hardware acceleration. To get ready for the future of GDI, the next chapter is about DirectDraw programming.



Further Reading


If you want to know more about how printing and spooler work, grab Microsoft DDK and read its very detailed description of DDI interface, spooler architecture, and how to write a minidriver using the UniDriver architecture. DDK also comes with a sample driver, minidriver, EMF print processor, and a port monitor source code. The older version of Windows NT DDK even has the full source code for a PostScript printer driver.



Examining EMF spool files generated by the spooler can identify quite a few printing problems. Refer back to Chapter 16 for discussions and tools on understanding an EMF.




Sample Programs


Chapter 17 comes with a number of sample programs (see Tablee 17-2).


























Table�17-2. Sample Programs for Chapter 17

Directory

Description

Samples\Chapt_17\PrinterDevice

Program for querying printer spooler related information and printer device context information. Based on an earlier program for display device.

Samples\Chapt_17\Printer

Test program for sending raw data to spooler, sending EMF to spooler, print dialog box, page setup dialog box, simple print loop, KSurface class, KPageCanvas class, drawing lines and curves, area fills, bitmaps and texts device independently.

Samples\Chapt_17\CodePrint

Syntax-highlighting source-code viewing and printing, WYSIWGY text formating.

Samples\Chapt_17\ImagePrint

JPEG image viewing and printing program, supporting sending JPEG to printer, uses the JPEG library in the Samples\include\jlib directory.







< BACK  NEXT >





No comments: