| RMC_Draw2Printer function. | ||
| Draws a chart onto a printer | ||
| Syntax | ||
| nResult (LONG) = RMC_Draw2Printer( ByVal nCtrlId (LONG), Optional ByVal nPrinterDC (LONG), Optional ByVal nLeft (LONG), Optional ByVal nTop (LONG), Optional ByVal nWidth (LONG), Optional ByVal nHeight (LONG), Optional ByVal nType (LONG) ) |
||
| Parameter | ||
| nCtrlId (LONG) | ||
| Unique ID of the chart control, which shall be printed. | ||
| nPrinterDC (LONG) | ||
| A valid printer DC. If omitted or 0, 1 or 2: the default printer is used. If no default printer is found, the first printer is used. If 1: printing takes place in portrait mode; if 2: printing takes place in landscape mode. | ||
| nLeft (LONG) | ||
| Left corner of the output in millimeter. See Remarks | ||
| nTop (LONG) | ||
| Top of the output in millimeter. See Remarks | ||
| nWidth (LONG) | ||
| Width of the output in millimeter. See Remarks | ||
| nHeight (LONG) | ||
| Height of the output in millimeter. See Remarks | ||
| nType (LONG) | ||
|
RMC_EMF (Default): printing is done through a memory based EMF file. RMC_EMFPLUS Printing is done through a memory based EMF+ file. RMC_BMP: printing is done through a bitmap. To be honest: I can't give a general advice, which option you should use. I found no significant differences on my printer (HP G85) between the three modes. I think, in most cases the default setting will be alright, but make your own experiences. | ||
| Return value | ||
| 0 | ||
| No error, function succeeded. | ||
| RMC_ERROR_CTRLID | ||
| Wrong control ID (0 or no chart with this control ID was found). | ||
| RMC_ERROR_EMF | ||
| Error while creating the EMF file for printing. | ||
| RMC_ERROR_PRINT | ||
| Error while creating the printer DC. | ||
| Remarks | ||
|
You can call RMC_Draw2Printer either any time after you called RMC_Draw
(for instance if your user clicked on an available Print button) or "stand alone", without painting on the screen.
In this case parameter nExportOnly in RMC_CreateChart() must be TRUE.
Then, after the necessary function calls for designing your chart, you call RMC_Draw2Printer,
followed by RMC_DeleteChart()!
If you set the nLeft, nTop,nWidth and nHeight parameters the output will be accordingly positioned on the paper with possibly small deviations. If you omit the value(s) the following rules apply:
| ||