| RMC_CreateChartFromFileOnDC function. | ||
| Create a new chart by reading a *.rmc-file or passing the data string on the device context (DC) of a PowerBASIC 8 GRAPHIC BITMAP, GRAPHIC CONTROL or GRAPHIC WINDOW | ||
| Syntax | ||
| nResult (LONG) = RMC_CreateChartFromFileOnDC( ByVal nParentDC (LONG), ByVal nCtrlId (LONG), ByVal nX (LONG), ByVal nY (LONG), ByRef sRMCFile (ASCIIZ) ) |
||
| Parameter | ||
| nParentDC (LONG) | ||
| Device context of the PB8 GRAPHIC BITMAP, GRAPHIC CONTROL or GRAPHIC WINDOW, on which the chart will be shown. See Remarks | ||
| nCtrlId (LONG) | ||
| Unique ID of the control. | ||
| nX (LONG) | ||
| Upper left corner of the chart in the parent window (in Pixel). | ||
| nY (LONG) | ||
| Top corner of the chart in the parent window (in Pixel). | ||
| sRMCFile (ASCIIZ) | ||
| Full name of a *.rmc-file which was created with RMCDesigner.
OR: The content of such a file as plain data string. So you could save for example the data string in your EXE-file or in a resource-file instead of having several *.rmc-files along with your application. In the Designer you can copy the data string (besides the source code) of the chart you've designed into the clipboard. | ||
| Return value | ||
| 0 | ||
| No error, function succeeded. | ||
| RMC_ERROR_PARENTHANDLE | ||
| Parent DC is 0. | ||
| RMC_ERROR_CTRLID | ||
| Control ID is 0. | ||
| RMC_ERROR_MAXINST | ||
| The maximum count of control instances (20) within one programm is exceeded. | ||
| RMC_ERROR_NOGDIP | ||
| No GDIPLUS.DLL was found. | ||
| RMC_ERROR_RMCFILE | ||
| Error opening sRMCFile or file is empty or an empty data string was passed. | ||
| Remarks | ||
|
If you need to know the width and height of the chart, which shall be painted call
RMC_GetChartsizeFromFile() before you create (or show) the chart.
You may use this way of creating a chart with PowerBASIC 8.xx, if you plan to sophisticate your chart with additional text or paintings, after it is painted on the DC. If you don't plan to follow up the chart, there is no reason why you should use this way instead of RMC_CreateChart(). If you create your chart on a DC, it will behave like any other GRAPHIC BITMAP/CONTROL, you can print it and save it with the corresponding PB commands. Important: Immediate after drawing the chart with RMC_Draw() the internal bitmap inside RMChart will be destroyed, otherwise it would not be possible to manipulate the chart from your PB8 application. So you can not use RMC_Draw2Printer() for printing or RMC_Draw2File() for saving the chart. Printing must be done with the PowerBASIC commands, but I provided an additional functionality for you which you optionally can use for saving the chart: with RMC_SaveBMP() you can save (any) PowerBASIC 8 BITMAP as a *.jpg or *.png file. | ||