ImageGear provides a simple all-purpose printing function that will print any image to a graphics-capable printer. This function is:
Copy Code | |
---|---|
IG_dspl_image_print ( HIGEAR hIGear, DWORD dwGrpID, HDC hDC, BOOL bDirectToDriver ); |
This function prints a HIGEAR image to the current default printer according to the display parameter specified by dwGrpID group. There is a special group IG_GRP_DEFAULT_PRINT that can be used to print an image with the default print options.
- When bDirectToDriver = TRUE, ImageGear sends the image's DIB directly to the printer's device driver. In this case, the entire procedure is controlled by the printer's driver. If your printer has special capabilities such as color, and if the driver supports these, then your image can be printed with these features.
- When bDirectToDriver = FALSE, ImageGear handles the printing procedure as follows:
- ImageGear first reduces the image to 1-bit, if necessary (such as by using a Bayer dithering algorithm).
- It then sends each raster line to the printer driver individually.
- If you've called IG_status_bar_CB_register() to declare a status bar callback function, ImageGear calls your callback function after each raster line is sent. This type of callback permits you to display a status bar showing the completed percentage, or a message box displaying the page number being sent. You can also detect a keystroke or mouse selection indicating that the user wants to cancel the printing process.
- The sample application program "print.c" demonstrates how to implement these and other features, including an initial Print Dialog Box.
In general, bDirectToDriver = FALSE gives you greater control of the printing process, while bDirectToDriver = TRUE gives you faster printing.
Note also that the functions IG_dspl_page_print(), IG_dspl_document_print(), and IG_dspl_document_print_custom() allow you to specify how to print a single image on a page, and how to print a list of images on a page, specifying how to place the images relative to the page's borders.