TeeChart MFA - How to Save Chart as Jpeg/Png Image
TeeChart MFA - How to Save Chart as Jpeg/Png Image
Hi,
Maybe I just missed this, but what I need to be able to do is to save the Chart as a .png or .jpeg image files so that I can e-mail as an attachment using TeeChart Mono for Android 2012 ?
I am open to alternative approaches.
Thanks
Bernard
Maybe I just missed this, but what I need to be able to do is to save the Chart as a .png or .jpeg image files so that I can e-mail as an attachment using TeeChart Mono for Android 2012 ?
I am open to alternative approaches.
Thanks
Bernard
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: TeeChart MFA - How to Save Chart as Jpeg/Png Image
Hello Bernard,
This is not supported yet. Bitmap generation was implemented for the following maintenance release. No other image formats have been implemented yet. If you are interested I can send you a test version of the Bitmap export.
This is not supported yet. Bitmap generation was implemented for the following maintenance release. No other image formats have been implemented yet. If you are interested I can send you a test version of the Bitmap export.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: TeeChart MFA - How to Save Chart as Jpeg/Png Image
Hello Bernard,
Actually TChart.Bitmap had already been implemented in the assembly I sent you on 14th December 2012. A usage example can be found in ChartView.cs in the demo attached. That demo converts the Bitmap into a JPEG.
Hope this helps!
Actually TChart.Bitmap had already been implemented in the assembly I sent you on 14th December 2012. A usage example can be found in ChartView.cs in the demo attached. That demo converts the Bitmap into a JPEG.
Hope this helps!
- Attachments
-
- MonoAndroidDemo.zip
- (239 KiB) Downloaded 611 times
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: TeeChart MFA - How to Save Chart as Jpeg/Png Image
Sorry for the delay, your solution works just fine!!!!
I really appreciate it.
Thanks
Bernard
I really appreciate it.
Thanks
Bernard
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: TeeChart MFA - How to Save Chart as Jpeg/Png Image
Hi Bernard,
You're welcome. I'm glad to hear that, thanks for the feedback.
You're welcome. I'm glad to hear that, thanks for the feedback.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: TeeChart MFA - How to Save Chart as Jpeg/Png Image
Hello Narcís,
If you have a build that allows exporting to bitmap and fixes defect TM63016457 (the pinch/zoom crash), I would be interested to try it out.
Regards,
Brian
If you have a build that allows exporting to bitmap and fixes defect TM63016457 (the pinch/zoom crash), I would be interested to try it out.
Regards,
Brian
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: TeeChart MFA - How to Save Chart as Jpeg/Png Image
Hello Brian,
Yes, I just sent you an email with the URL to download that assembly.
Yes, I just sent you an email with the URL to download that assembly.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: TeeChart MFA - How to Save Chart as Jpeg/Png Image
Hello Narcís,
Thanks! The build seems to allow me to get the bitmap nicely, but after I get the bitmap the view no long seems to draw to the android device screen. Do I need to do something to the chart after getting the bitmap to make it draw to the screen again? I noticed the .Draw(canvas) method seems to have similar behavior across several of the builds I tried; after it is called I don't see anything on the device screen.
Thanks! The build seems to allow me to get the bitmap nicely, but after I get the bitmap the view no long seems to draw to the android device screen. Do I need to do something to the chart after getting the bitmap to make it draw to the screen again? I noticed the .Draw(canvas) method seems to have similar behavior across several of the builds I tried; after it is called I don't see anything on the device screen.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: TeeChart MFA - How to Save Chart as Jpeg/Png Image
Hello Brian,
Which Zoom.Style setting are you using to reproduce this? Is your chart set to ZoomStyles.Classic? Does this occur with ZoomStyles.FullChart or ZoomStyles.InChart? You should create the bitmap after the chart has been added and painted to the view so that it has valid View dimensions the CreateBitmap method can use, for example: in a button, a touch event, menu option, etc.
Thanks in advance.
Which Zoom.Style setting are you using to reproduce this? Is your chart set to ZoomStyles.Classic? Does this occur with ZoomStyles.FullChart or ZoomStyles.InChart? You should create the bitmap after the chart has been added and painted to the view so that it has valid View dimensions the CreateBitmap method can use, for example: in a button, a touch event, menu option, etc.
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: TeeChart MFA - How to Save Chart as Jpeg/Png Image
Hello Narcís,
I set Zoom.Style to ZoomStyles.FullChart and found that when I set up the chart and draw the bitmap in my activity OnCreate, the chart view appears to be empty (no chart background, title, etc). When I instead give data to the chart later from a button press and follow this with bitmap creation through the .Draw(canvas, Rect) method, the chart's view is present but appears as it did before I added data (the title and background show), where the bitmap looks correct; when I remove the .Draw call, the data appears on the device again.
I did find that of course simply creating a new chart and disposing of the old one after creating a bitmap makes the chart appear again on the device, so this is the approach I am using for now.
I set Zoom.Style to ZoomStyles.FullChart and found that when I set up the chart and draw the bitmap in my activity OnCreate, the chart view appears to be empty (no chart background, title, etc). When I instead give data to the chart later from a button press and follow this with bitmap creation through the .Draw(canvas, Rect) method, the chart's view is present but appears as it did before I added data (the title and background show), where the bitmap looks correct; when I remove the .Draw call, the data appears on the device again.
I did find that of course simply creating a new chart and disposing of the old one after creating a bitmap makes the chart appear again on the device, so this is the approach I am using for now.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: TeeChart MFA - How to Save Chart as Jpeg/Png Image
Hello Brian,
Creating the Bitmap as in the code below works fine for me. Does it work at your end? Could you please attach a simple example project we can run "as-is" to reproduce the problem here?
Thanks in advance.
Creating the Bitmap as in the code below works fine for me. Does it work at your end? Could you please attach a simple example project we can run "as-is" to reproduce the problem here?
Code: Select all
void tChart1_Touch(object sender, View.TouchEventArgs e)
{
Android.Graphics.Bitmap bmp = tChart1.Bitmap;
}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |