LPrint::PrintFast

Summary

Prints the associated class object's bitmap to the specified device. This function does no preprocessing of the image.

Syntax

#include "ltwrappr.h"

virtual HDC LPrint::PrintFast(hDC=NULL, nX=0, nY=0, nWidth=0, nHeight=0, bEndDoc=TRUE)

Parameters

HDC hDC

Handle to the device context (DC) where the bitmap is to print. The mapping mode of the device context must be MM_TEXT.

L_INT nX

X position to start the print. Pass a 0 to center the image horizontally on the page.

L_INT nY

Y position to start the print. Pass a 0 to center the image vertically on the page.

L_INT nWidth

The printed width. The value is in dots, and the actual width depends on the dots per inch (DPI) of the printer.

Pass a 0 to let the function calculate the width. If you specify only the width or only the height, the function calculates the remaining dimension. If you pass zeros for both width and height, the function calculates the maximum dimensions that fit on the page while preserving the aspect ratio.

L_INT nHeight

The printed height. The value is in dots, and the actual height depends on the dots per inch (DPI) of the printer.

Pass a 0 to let the function calculate the height. If you specify only the width or only the height, the function calculates the remaining dimension. If you pass zeros for both width and height, the function calculates the maximum dimensions that fit on the page while preserving the aspect ratio.

L_BOOL bEndDoc

Flag that indicates to LEADTOOLS whether you plan to print another image on the same page or not. Possible values are:

Value Meaning
TRUE LEADTOOLS will free the hDC and send a paper eject.
FALSE LEADTOOLS will assume that you plan to print another bitmap.

Returns

Value Meaning
> 0 Function was successful. If bEndDOC is FALSE, the return value is the printer HDC.
0 An error occurred.

Comments

You can specify the position and dimensions of the printed image, or let the function calculate values for you as follows:

The function is designed to let you print multiple bitmaps on the same page. To do so, call the function with the fEndDoc argument set to FALSE for each image except the last one on the page. Then call the function with the fEndDoc argument set to TRUE. If you do not set the fEndDoc argument to TRUE on the last call, the hDC will not be freed, and the page will not flush.

If fEndDOC is FALSE, you can use the returned hDC to draw to the current printer page. If your printing more than one page and you passed FALSE for fEndDoc, be sure to call EndPage then StartPage between each call to LPrint::PrintFast.

An alternative for greater flexibility is the LPaint::PaintDC function, which you can use by specifying the printer as the display surface.

Required DLLs and Libraries

See Also

Functions

Topics

Example

For an example, refer to LPrint::Print.

Help Version 22.0.2023.2.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.