Einzelnen Beitrag anzeigen

Benutzerbild von DGL-luke
DGL-luke

Registriert seit: 1. Apr 2005
Ort: Bad Tölz
4.149 Beiträge
 
Delphi 2006 Professional
 
#5

Re: Richtungs bzw. Vektorpfeil zeichnen

  Alt 29. Jun 2007, 23:10
Die Koordinaten sind natürlich Offsets!

Delphi-Quellcode:
if (x1 - x2)<>0 then a:=arctan((y1 - y2) / (x1 - x2));

//FBitmap.Canvas.MoveTo(x2,y2); //Der Zeichenstift sollte ja noch am Ende des Pfeils stehen.
FBitmap.Canvas.LineTo(x2-Round(cos(a-30)*3), Round(y2-sin(a-30)*3));
FBitmap.Canvas.LineTo(x2-Round(cos(a+30)*3), Round(y2-sin(a+30)*3));
FBitmap.Canvas.LineTo(x2,y2);
Damit sollte er das komplette Dreieck zeichnen.
Lukas Erlacher
Suche Grafiktablett. Spenden/Gebrauchtangebote willkommen.
Gotteskrieger gesucht!
For it is the chief characteristic of the religion of science that it works. - Isaac Asimov, Foundation I, Buch 1
  Mit Zitat antworten Zitat