Friday 15 May 2015

delphi - Clear lines drawn with TCanvas -


I am using TCanvas to draw the blue line whenever the mouse button is pressed, and whenever the right mouse button Whenever I click on the click, another line is drawn to the chart. What I want to do is clean the old line, and then draw a new line.

Below is some sample code.

code of onClick event

  Process TForm2.Chart1ChartClick (Sender: TJvChart; Button: TMouseButton; Shift: TshoftState; X, Y, Chartwell Index, Chartpain Index: Integer; Wier Shohint, HuntfestlineBold: Boolean; Hintsters: Teatrings); Then start = button = mblteft canvas pin again. Color: = clue; Plotohorient (X, Y); Finally if the button = MBRITE then the canvas starts. pen. Color: = clad; Plotohorient (X, Y);  

Start starting with the canvas // Horizontal line drawn (X, Y); // does not seem to reach the end of 4 4 line line lines (X, chart 1. option. XStartOffset-4); Hatoto (X, Y); Lineto (X, Chart 1. Options. XStartOffset + + Chart1.Options.Yend); End; End;

I was able to work to save the old X, and Y values ​​where the line When the mouse was clicked again, I refresh the chart and repeat the line again

No comments:

Post a Comment