Saving ChartStream to File
Posted: Thu Nov 19, 2009 9:08 pm
Hi !
I use SaveChartToStream to store a Chart to a stream Well done sentence
Ok now I want to save this Stream to a file. This could be done by
Well this is for sure not a valid methode for storing a chart into a file - but it still works!
I loaded the stored stream into TeeChart Office and it works.
There is also no problem to convert such a stream file with "ConvertTeeFileToText" to a Tee Text file.
So what do you say about this? Is this practicable? Normally I use this code to store the chart within a Thread:
But this code needs a lot of space in the memory. First of all the real chart, the Stream Copy and finally the ChartCopy which is only for storing into a file.
If I use the workaround from above I save 1/3 of memory consumption.
I use SaveChartToStream to store a Chart to a stream Well done sentence
Ok now I want to save this Stream to a file. This could be done by
Code: Select all
<STREAM>.SaveToFile(FileName);
I loaded the stored stream into TeeChart Office and it works.
There is also no problem to convert such a stream file with "ConvertTeeFileToText" to a Tee Text file.
So what do you say about this? Is this practicable? Normally I use this code to store the chart within a Thread:
Code: Select all
ChartStream.Position := 0;
LoadChartFromStream(TCustomChart(ChartCopy), ChartStream);
ChartStream.Free;
SaveChartToFile(TCustomChart(ChartCopy),
FileName,
True, // Include Data
False); // Text Format ?
ChartCopy.Free;
If I use the workaround from above I save 1/3 of memory consumption.