Save Image of Multiple Chart

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
amol
Advanced
Posts: 231
Joined: Tue Mar 29, 2005 5:00 am

Save Image of Multiple Chart

Post by amol » Fri Oct 31, 2014 11:33 am

Hi Steema,
We want to save the single image of Multiple opened charts in different tiled windows as shown in image. as shown in attached image
save as image.png
Save Image of Multiple Chart
save as image.png (135.54 KiB) Viewed 13977 times
Please provide any solution asap.
Thanks in advance.

Thanks&Regards
Plano Research

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Save Image of Multiple Chart

Post by Christopher » Fri Oct 31, 2014 11:52 am

Hello!

This isn't really a TeeChart issue per se, as TeeChart is perfectly capable of exporting itself to an image.

If you want to combine two (or more) images to one image, you can create a new bitmap then paint each image onto it. First create a bitmap at runtime, then create the graphics from the image and then use this graphics to draw your images to it.
Best Regards,
Christopher Ireland / 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

amol
Advanced
Posts: 231
Joined: Tue Mar 29, 2005 5:00 am

Re: Save Image of Multiple Chart

Post by amol » Thu Nov 13, 2014 12:35 pm

Hi


We are creating a application in window form conatins a panel and Panel contains Teechart and few textboxes and labels. We are trying to implement functionality "save as image" of all contents of panel. All contents saved as image but teechart is not exported as image. We are using this code below:

using (Bitmap bitmap = new Bitmap(panel2.ClientSize.Width,
panel2.ClientSize.Height))
{
panel2.DrawToBitmap(bitmap, panel2.ClientRectangle);
bitmap.Save(deskTopPath + @"/snap_" + snapCount.ToString() + @".png", ImageFormat.Png);
}

How to achive this functionality?

Please reply soon.

Thanks

Plano

amol
Advanced
Posts: 231
Joined: Tue Mar 29, 2005 5:00 am

Re: Save Image of Multiple Chart

Post by amol » Thu Nov 13, 2014 12:50 pm

Hi Team,

A demo project is attached of above mail. Please find.

Thanks

Plano Team
Attachments
WindowsFormsApplication1.rar
Demo Project
(134.73 KiB) Downloaded 648 times

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Save Image of Multiple Chart

Post by Christopher » Thu Nov 13, 2014 2:52 pm

amol wrote: A demo project is attached of above mail. Please find.
This seems to be a limitation of the Control.DrawToBitmap Method:
The DrawToBitmap method is not supported for ActiveX controls. You can override the OnPrint event and provide custom printing logic if required.
The DrawToBitmap method has the following limitations:
An ArgumentException might be thrown for large bitmaps. The maximum allowable size varies by machine.
DrawToBitmap does not support the Ink controls for the Windows XP Tablet PC Edition 2005 operating system.
DrawToBitmap does not draw a child TextBox if the Visible property of the TextBox is set to false.
Controls inside containers are rendered in reverse order.
DrawToBitmap is not fully functional for the RichTextBox; only the border of a bitmap is drawn.
If DrawToBitmap cannot even render Microsoft's own controls such as RichTextBox, then I'm afraid it doesn't surprise me that TeeChart is not being rendered.
Best Regards,
Christopher Ireland / 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

amol
Advanced
Posts: 231
Joined: Tue Mar 29, 2005 5:00 am

Re: Save Image of Multiple Chart

Post by amol » Fri Nov 14, 2014 5:41 am

Hi Steema,

Please provide me the solution for that.


Thanks
Plano

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Save Image of Multiple Chart

Post by Christopher » Fri Nov 14, 2014 9:26 am

amol wrote: Please provide me the solution for that.
I think I have already suggested a solution to this issue in my post here:

Code: Select all

If you want to combine two (or more) images to one image, you can create a new bitmap then paint each image onto it. First create a bitmap at runtime, then create the graphics from the image and then use this graphics to draw your images to it.
The issue with TeeChart not rendering to a Panel's bitmap is a Microsoft issue, not a Steema issue, I'm afraid.
Best Regards,
Christopher Ireland / 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

amol
Advanced
Posts: 231
Joined: Tue Mar 29, 2005 5:00 am

Re: Save Image of Multiple Chart

Post by amol » Fri Nov 14, 2014 9:52 am

Hi Steema

Please create a sample application.

Thanks
Plano

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Save Image of Multiple Chart

Post by Christopher » Fri Nov 14, 2014 9:59 am

amol wrote: Please create a sample application.
With all due respect, I feel this is a generic programming issue and not one specific to either the TeeChart API or the TeeChart source code.

May I suggest that you make the first attempt at this, and if you are unsuccessful then please post your code here so that I can help you with it.
Best Regards,
Christopher Ireland / 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

Post Reply