SaveOnFile

Declaration: ChartBook.Charts[].SaveOnFile (FName: string; BlkWhite, IncludeCrossHairs: boolean);
The method SaveOnFile creates a screenshot of the chart and stores it in the file FName. The bitmap file contains the whole chart display, including axes and captions. The bitmap is stored as a black-and-white copy if the parameter BlkWhite is set to TRUE. Setting the parameter IncludeCrossHairs to TRUE includes the current crosshair(s) in the screenshot. The file extension controls the type of the file; allowed extensions are '.bmp' (uncompressed Windows BMP file), '.png' (PNG file, lossless compression) and '.jpg' (JPEG file, lossy compression).

The function returns the following error codes:

 0 ... everything is OK, the screenshot has been stored
-1 ... invalid file format (note the file extension controls the format)
-2 ... cannot save file (disk full or write protected)