Hallo zusammen,<br>
Ich möchte einen Makierungspfeil in TCanvas zeichnen wobei die Spitze x1,x2 von MouseDown ist. Meine Idee war folgende <br>
<PRE>
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
x1:=x;
y1:=y;
end;
procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
With Form1 do
begin
// Zeichne die Spitze
Canvas.Brush.Color := clTeal;
Canvas.Polygon([Point(x1,y1),Point(?,?),Point(?,?)]);
<b>// Wie ist die berechnung von ?</b>
// Dann eine Linie von der Spitze bis MouseUp
Canvas.MoveTo(x1,y1);
Canvas.LineTo(x,y);
end;
end;
</pre><br>
Hat jemand eine Idee ?
Ich möchte einen Makierungspfeil in TCanvas zeichnen wobei die Spitze x1,x2 von MouseDown ist. Meine Idee war folgende <br>
<PRE>
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
x1:=x;
y1:=y;
end;
procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
With Form1 do
begin
// Zeichne die Spitze
Canvas.Brush.Color := clTeal;
Canvas.Polygon([Point(x1,y1),Point(?,?),Point(?,?)]);
<b>// Wie ist die berechnung von ?</b>
// Dann eine Linie von der Spitze bis MouseUp
Canvas.MoveTo(x1,y1);
Canvas.LineTo(x,y);
end;
end;
</pre><br>
Hat jemand eine Idee ?
Comment