TeeChart FireMonkey (Windows,OSX,iOS & Android) for Embarcadero RAD Studio, Delphi and C++ Builder (XE5+)
-
OceaBen
- Newbie
- Posts: 4
- Joined: Tue Sep 03, 2013 12:00 am
Post
by OceaBen » Wed Nov 20, 2013 8:49 am
Hi,
I'm using the last version of TeeChart 2013 (posted yesterday) on Delphi XE5 for iOS application.
TChart.SaveToBitmapFile doesn't seem to be working. This function returns false:
Code: Select all
Chart1.SaveToBitmapFile(GetHomePath + PathDelim + 'Documents' + PathDelim + 'test.BMP');
Result := FileExists(GetHomePath + PathDelim + 'Documents' + PathDelim + 'test.BMP');
Is there anyway to export Chart in bmp ?
Or in other format (jpeg, pdf,....)
Thanks in advance.
Ben
-
Narcís
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
Post
by Narcís » Wed Nov 20, 2013 11:39 am
Hi Ben,
The problem is the .bmp extension as explained at
StackOverflow. Changing the filename to .jpg solves the problem:
Code: Select all
FileName:=GetHomePath + PathDelim + 'Documents' + PathDelim + 'test.jpg';
Chart1.SaveToBitmapFile(FileName);
For a PDF export you can do this:
Code: Select all
uses
FMXTee.Canvas.PDF;
procedure TForm1.Button1Click(Sender: TObject);
var
FileName : String;
Extension : String;
begin
Extension:='pdf';
FileName:=GetHomePath + PathDelim + 'Documents' + PathDelim + 'test.' + Extension;
//Chart1.SaveToBitmapFile(FileName); //use .jpg http://stackoverflow.com/questions/19482829/firemonkey-taking-and-saving-pictures
TeeSaveToPDFFile(Chart1, FileName, Round(Chart1.Width), Round(Chart1.Height));
end;
-
OceaBen
- Newbie
- Posts: 4
- Joined: Tue Sep 03, 2013 12:00 am
Post
by OceaBen » Wed Nov 20, 2013 1:03 pm
Perfect. Thank you!
-
Narcís
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
Post
by Narcís » Wed Nov 20, 2013 2:00 pm
Hi OceaBen,
As an update, we have added this to the bug list [
ID118] to be improved for future releases. If you sign up at our bugzilla system I can add you to the CC List to be updated about the issue's evolution.