how do i save three charts in single image file (i.e. jpeg)
how do i save three charts in single image file (i.e. jpeg)
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
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 :
(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.
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
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.
Pep Jorge
http://support.steema.com
http://support.steema.com