I can export a graph from within the IDE to JPEG, but I can't work out how to do it programatically.
I need to specify the image size as well as the location\filename. Can anyone point me in the right direction?
Thanks
Exporting a Chart to a JPEG
Hi,.
There is an example available at our FAQ pages. Check the following
link
The example is for GIF format, but very similar code can be used with JPEG format:
There is an example available at our FAQ pages. Check the following
link
The example is for GIF format, but very similar code can be used with JPEG format:
Code: Select all
Uses TeeJPEG;
begin
With TJPEGExportFormat.Create(Self) do
begin
Panel := Chart1;
Width := 300;
Height := 300;
SaveToFile('ChartImage.jpg');
finally
Free;
end
end
Marjan Slatinek,
http://www.steema.com
http://www.steema.com
Hi, Steve.
Save each page to a seperate file ? If this is the case then simply call the export for each page.
If on the other hand you're trying to save multiple charts to a sigle jpeg file (image), then the only solution is to create a temporary bitmap, then paint each page on section of this bitmap and then finally convert/export this temporary bitmap to jpeg file. I think a similar problem has been discussed and solved in this forum (for metafiles, but the same approach can be used for other formats).
Save each page to a seperate file ? If this is the case then simply call the export for each page.
If on the other hand you're trying to save multiple charts to a sigle jpeg file (image), then the only solution is to create a temporary bitmap, then paint each page on section of this bitmap and then finally convert/export this temporary bitmap to jpeg file. I think a similar problem has been discussed and solved in this forum (for metafiles, but the same approach can be used for other formats).
Marjan Slatinek,
http://www.steema.com
http://www.steema.com