![]() |
AW: TPlotgrid zeichnet Strich in Polygon
... hier die Lösung, aus
![]() :-)
Code:
var
FPoints: TPolygon; procedure TfMain.CalculateCos; var i: Integer; begin SetLength(FPoints, Resolution + 1); // Alloc space for number of points to be calculated SetParams; for i := 0 to High(FPoints) do begin FPoints[i].X := Origin.X + Radian * xPixels / Pi; // Calculate X value with scaling FPoints[i].Y := Origin.Y - cos(Radian) * yPixels; // Calculate Y value (f(X)) with scaling Radian := Radian + Interval; // Set next point end; end; procedure TfMain.PlotGridPaint(Sender: TObject; Canvas: TCanvas; const ARect: TRectF); var i: Integer; begin PlotGrid.Canvas.Stroke.Thickness := 2; // Liniendicke CalculateCos; // hier nur Cosinus PlotGrid.Canvas.Stroke.Color := TAlphaColorRec.White; for i := 1 to High(FPoints) do PlotGrid.Canvas.DrawLine(FPoints[i - 1], FPoints[i], 1); end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 22:32 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-2025 by Thomas Breitkreuz