This function draws an image onto the printer device context within the specified rectangle.
Declaration:
Copy Code | |
---|---|
AT_ERRCOUNT ACCUAPI IG_dspl_page_print(
[IN] HIGEAR hIGear,
[IN] DWORD dwGrpID,
[IN] HDC hDC,
[IN] const LPAT_DRECTANGLE lpLayout,
[IN] BOOL bDirectToDriver
);
|
Arguments:
Name | Type | Description |
hIGear | HIGEAR | ImageGear handle of image. |
dwGrpID | DWORD | Identifier of group from which to get printing options. |
hDC | HDC | Handle of printer device context on which to draw the image. |
lpLayout | const LPAT_DRECTANGLE |
Rectangle which specifies how the image is located on the page. This rectangle is calculated in page-relative units, and as actual page resolutions are obtained it translates the rectangle into real coordinates and assigns ClipRect according to the following rules: ClipRect.x = lpLayout->x*nPageWidth ClipRect.y = lpLayout->y*nPageHeight ClipRect.width = lpLayout->width*nPageWidth ClipRect.height = lpLayout->height*nPageHeight |
bDirectToDriver | BOOL | 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. |
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:
Print, Display
Example:
Copy Code | |
---|---|
HIGEAR hIGear; /* HIGEAR handle of image */ DWORD nGrpID; /* display group identifier */ BOOL bDirect; /* direct to driver flag */ AT_DRECTANGLE Layout; PRINTDLG pd; /* print dialog structure */ ... case ID_FILE_PRINT: ... if( PrintDlg(&pd) ) { ... /* print image in the middle of the page and at 0.5 of width and height of the page */ Layout.x = 0.25; Layout.y = 0.25; Layout.width = 0.5; Layout.height = 0.5; IG_dspl_page_print( hIGear, nGrpID, pd.hDC, &Layout, bDirect ); ... } ... break; ... |
Remarks:
Printing resolution depends on the current printer setting. The 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 ImageGear capabilities such 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. If you are using ImageGear ArtX Component in your application please use IG_dspl_artx_page_print() function. |