![]() |
Zeilen kommentieren
hi ich habe mal ne frage, habe leider null ahnung von delphi und würde gern wissen was die untenstehenden Zieln zu bedeuten haben.? Ich hoffe ihr könnt mir weiterhelfen.
Delphi-Quellcode:
RAdius:=StrToFloat(LabeledEdit5.Text); Winkel1:=round(90+StrTofloat(LabeledEdit1.Text)/2); Winkel2:=round(90-StrToFloat(LabeledEdit1.Text)/2); Point2.X:=Round(Mittex+Radius*sin(pi*(90-Winkel2)/180)); Point2.Y:=round(MitteY-Radius*cos(pi*(90-winkel2)/180)); Point3.X:=Round(Mittex+Radius*sin(pi*(90-Winkel1)/180)); Point3.Y:=round(MitteY-Radius*cos(pi*(90-winkel1)/180)); if Point2.x=Point3.X then begin Point2.X:=Point2.X+1; Point3.X:=Point3.X-1; end; Bmp:=TBitMap.Create; Bmp.Width:=Image1.Width; Bmp.Height:=Image1.Height; With Bmp do begin Canvas.Pen.Width:=2; Canvas.Pen.Color:=ClBlack; Canvas.Brush.Color:=ClWhite; // Canvas.Ellipse(Rand,Height-Rand, Width-Rand,Rand); Canvas.Pen.Width:=2; Canvas.Brush.Color:=ClSkyBlue; Canvas.Pie(Round(Mittex-Radius),Round(MitteY+Radius), Round(Mittex+Radius),Round(MitteY-Radius), Point2.X,Point2.Y,Point3.X,Point3.Y); Canvas.Pen.Color:=ClBlack; Canvas.MoveTo(Point1.X,Point1.Y); Canvas.LineTo(Point2.X,Point2.Y); Canvas.MoveTo(Point1.X,Point1.Y); Canvas.LineTo(Point3.X,Point3.Y); Canvas.Pen.Color:=ClBlue; Canvas.LineTo(Point2.X,Point2.Y); Canvas.Pen.Color:=ClRed; Canvas.Arc(Round(Mittex-Radius),Round(MitteY+Radius), Round(Mittex+Radius),Round(MitteY-Radius), Point2.X,Point2.Y,Point3.X,Point3.Y); end; Image1.Picture.Bitmap.Assign(Bmp); Bmp.Free; end; end. |
Re: Zeilen kommentieren
Guck doch erstmal in der Hilfe oder nutze Google, dann dürfte sich das meiste von selbst erschließen. Wenn dann noch was unklar ist, kannst du ja noch mal fragen.
|
Re: Zeilen kommentieren
erstmal wird was ausgerechnet
und dann etwas gezeichnet Was die Befehle machen, steht sehr gut erklärt in deiner Online-Hilfe von Delphi. "pi*(90-Winkel2)/180" Dieses rechnet aber einen Winkel (hier "Winkel2") in ° (Grad) in ein anderes Maßsystem um. Die Zeichenfunktionen nuzten nicht Grad, sondern Rad (hoff der Name stimmt), also sozusagen das [google]Bogenmaß[/google]. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:59 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz