Page 1 of 1

Export Image

Posted: Wed Nov 23, 2005 1:54 am
by 9638303
Dear Sir/Madam

I found a problem on export TChart Image, some of the serious was missing. Jpg and bmp also the same and we only use this 2 picture formats

Below is the sample code.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TChart1.Export.Image.JPEG.Height = 600
TChart1.Export.Image.JPEG.Width = 800
TChart1.Export.Image.JPEG.Quality = 100
TChart1.Export.Image.JPEG.Save("c:\a.jpg")
End Sub


Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TChart1.Series.Add(New Steema.TeeChart.Styles.Bar3D)
TChart1.Series(0).FillSampleValues(6)
End Sub



Thank & Best Regard
Eric

Posted: Wed Nov 23, 2005 10:03 am
by narcis
Hi Eric,

This is because the image has a different size than the chart. You should set images size to tChart's size or temporary change tChart's size. This code works fine here:

Code: Select all

		private void button1_Click(object sender, System.EventArgs e)
		{
			tChart1.Export.Image.JPEG.Width=tChart1.Width;
			tChart1.Export.Image.JPEG.Height=tChart1.Height;
			tChart1.Export.Image.JPEG.Quality=100;
			tChart1.Export.Image.JPEG.Save(@"C:\temp\a.jpg");

			tChart1.Export.Image.Bitmap.Width=tChart1.Width;
			tChart1.Export.Image.Bitmap.Height=tChart1.Height;
			tChart1.Export.Image.Bitmap.Save(@"C:\temp\a.bmp");
		}

Posted: Tue Nov 29, 2005 5:00 am
by 9638303
Dear Sir/Madam

That code not work for me and we don't have any problem in .net version 1. Now we upgrade to version 2, but feel really disappointed in this version. Until now you all haven't release the ready version for us to download. Every time to download the debug version we need to run ton of testing to make sure it work correct. but we never feel comfortable.....

Below is the sample code.

Dim Width, Height As Long
Width = Chart.Width
Height = Chart.Height
Chart.Height = 600
Chart.Width = 800
Chart.Export.Image.JPEG.Height = Chart.Height
Chart.Export.Image.JPEG.Width = Chart.Width
Chart.Export.Image.JPEG.Quality = 100
Chart.Export.Image.JPEG.Save("c:\c.jpg")
Chart.Width = Width
Chart.Height = Height

Posted: Tue Nov 29, 2005 2:59 pm
by narcis
Dear Eric,

The code that works fine here is:

Code: Select all

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        TChart1.Graphics3D.ClearClipRegions()
        Dim jpeg As Steema.TeeChart.Export.JPEGFormat = TChart1.Export.Image.JPEG
        jpeg.Width = 800
        jpeg.Height = 800
        jpeg.Save("C:\temp\chart.jpg")
    End Sub