Page 1 of 1

two questions about drawing

Posted: Tue Oct 15, 2013 5:42 am
by 16667562
The questions
1. Could you tell me whether could the Teechart Pro activeX drawing in the background,how to realize it ?
I have a file with the dates of ten curves ,I need automatic read ,drawing and then saved as pictures .In the process I do not want display the teechart .
2. I want to know the method that when I draw the second straight line the first one could be deleted at the same time .
I use the download way to drawing :
GetCanvas().MoveTo(X,GetGetChartRect().GetBottom());
GetCanvas().LineTo(X,GetGetChartRect().GetTop());

Re: two questions about drawing

Posted: Tue Oct 15, 2013 1:03 pm
by yeray
Hi,
slyt wrote:1. Could you tell me whether could the Teechart Pro activeX drawing in the background,how to realize it ?
I have a file with the dates of ten curves ,I need automatic read ,drawing and then saved as pictures .In the process I do not want display the teechart .
You could have a chart in a form, hiden. And you could populate that chart, export it as an image, clear it, populate it again, export it, etc etc
Ie:

Code: Select all

  TChart1.Visible = False
  
  Dim i As Integer
  For i = 0 To 2
    TChart1.ClearChart
    TChart1.Aspect.View3D = False
    TChart1.AddSeries scLine
    TChart1.Series(0).FillSampleValues
    TChart1.Export.asBMP.SaveToFile "C:\tmp\MyBMPChart" + Trim$((i + 1)) + ".bmp"
  Next i
slyt wrote:2. I want to know the method that when I draw the second straight line the first one could be deleted at the same time .
I use the download way to drawing :
GetCanvas().MoveTo(X,GetGetChartRect().GetBottom());
GetCanvas().LineTo(X,GetGetChartRect().GetTop());
These functions are for custom drawing. If you want to draw a line at a time and anotherone at another time, you should control this adding logic at the OnAfterDraw event, where the custom drawing techniques you pointed are usually used.

If any of the above aren't exaclty what you are trying to achieve, please try to arrange a simple example project we can run as-is to reproduce the exact situation you are experiencing.