This function allows you to print an array of images and specify the number of images per width (row) and per height (column) of the page.
Declaration:
Copy Code | |
---|---|
AT_ERRCOUNT ACCUAPI IG_dspl_document_print(
[IN] const LPHIGEAR lphIGear,
[IN] UINT nImageCount,
[IN] DWORD dwGrpID,
[IN] HDC hDC,
[IN] UINT nImagesPerWidth,
[IN] UINT nImagesPerHeight,
[IN] DOUBLE dblXSpace,
[IN] DOUBLE dblYSpace,
[IN] BOOL bDirectToDriver,
[IN] LPFNIG_IMAGESPOOLED lpfnImageSpooled,
[IN] LPVOID lpPrivateData
);
|
Arguments:
lphIGear | Array of ImageGear image handles to print. |
nImageCount | Number of elements in lphIGear array. |
dwGrpID | Identifier of group from which to get options for printing for each image. |
hDC | Handle of printer device context on which to draw images. |
nImagesPerWidth | Number of images that should be placed in row. |
nImagesPerHeight | Number of images that should be placed in column. |
dblXSpace | Horizontal destination between images in row in page's width relative coordinates. This means the actual destination in device coordinates is calculated as: xSpace = PageWidth*dblXSpace. |
dblYSpace | Vertical destination between images in column in page's height relative coordinates. This means the actual destination in device coordinates is calculated as: ySpace = PageHeight*dblYSpace. |
bDirectToDriver | If TRUE, then ImageGear does not perform image scaling, but uses the operating system's and driver's capabilities for this. If FALSE then ImageGear performs the scaling. |
lpfnImageSpooled | Callback function that will be called after each image is printed. |
lpPrivateData | Private data that will be passed to lpfnImageSpooled callback function in first parameter. |
Return Value:
Returns the number of ImageGear errors that occurred during this function call.
Supported Raster Image Formats:
All pixel formats supported by ImageGear Professional.
Sample:
Display, Print
Example:
Copy Code | |
---|---|
HIGEAR lphIGear[10]; /* array of HIGEAR handles of images */ DWORD nGrpID; /* display group identifier */ BOOL bDirect; /* direct to driver flag */ PRINTDLG pd; /* print dialog structure */ INT nPrivateInfo; ... case ID_FILE_PRINT: ... if( PrintDlg(&pd) ) { ... IG_dspl_document_print( lphIGear, 10, nGrpID, pd.hDC, 2, 3, 0.05, 0.05, bDirect, ImageSpooled, &nPrivateInfo ); ... } ... break; ... BOOL ACCUAPI ImageSpooled( LPVOID lpPrivate, /* Private data passed in */ UINT nImageNumber, /* Current image being spooled (1 based) */ UINT nPageNumber /* Current page number being spooled */ ) { ... return TRUE; /* return false to cancel printing */ } ... |
Remarks:
lpfnImageSpooled function will be called after each image is printed and can use the lpPrivateDataparameter as private data storage. bDirectToDriver parameter allows you to perform image scaling inside of ImageGear or leave this task to the printer driver and operating system. Usually, direct to driver printing (bDirectToDriver=TRUE) results in smaller output size and it works faster but not using it produces better quality and allows you to use such ImageGear capabilities as anti-aliasing during printing.
Special predefined option group IG_GRP_DEFAULT_PRINT can be used to print an image with the most common parameters. |