how do i save three charts in single image file (i.e. jpeg)

TeeChart for ActiveX, COM and ASP
Post Reply
amit
Newbie
Newbie
Posts: 3
Joined: Thu Feb 03, 2005 5:00 am

how do i save three charts in single image file (i.e. jpeg)

Post by amit » Wed May 16, 2007 8:54 am

i have three charts in vb and what to same in single image file or export to image file how can i do this using teechart functionality

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Feb 09, 2010 7:04 am

Hi,

there's not a way to do it automatically through TeeChart Pro methods, but you should be able to do it by using a PictureBox component, drawing the desired Charts into it and then save the image of the PictureBox to a file.

To draw the Charts into the PictureBox you can use the following code :

Code: Select all

Private Sub Command1_Click()
TChart1.Draw Picture1.hDC, 0, 0, Picture1.Width / Screen.TwipsPerPixelX, _
(Picture1.Height / Screen.TwipsPerPixelY) / 2

TChart2.Draw Picture1.hDC, 0, (Picture1.Height / Screen.TwipsPerPixelY _
) / 2, Picture1.Width / Screen.TwipsPerPixelX, _
Picture1.Height / Screen.TwipsPerPixelY
End Sub
(Modify the values depending on the number of Charts you want to draw.)

To save the Picture as image to a file I've found a good example which does at : http://www.vbaccelerator.com/codelib/gfx/vbjpeg.htm . Most likely there are some other ways to acomplish it but maybe that one could help.


Last bumped by 9525858 on Tue Feb 09, 2010 7:04 am.

Post Reply