Einzelnen Beitrag anzeigen

Chris211183

Registriert seit: 19. Sep 2013
Ort: Braunschweig
204 Beiträge
 
Delphi 6 Professional
 
#13

AW: Probleme mit Sinus Darstellung

  Alt 26. Feb 2015, 11:05
Hier mal mein Code, im Anhang ein Screenshot:

Prinzipiell das, was es machen soll, sieht bloß ekelig aus

Delphi-Quellcode:
FPoints : Array[0..144] of TPoint;
.
.
.
procedure THixHistoGraph.DrawGridScale;

var
XRangePixels, YRangePixels: Double;
Start: TPoint;
Radian, Interval: Double;
i : Integer;

begin
   XRangePixels := (Width - GapLeft- GapRight) / (FXScale.ValGap);
   YRangePixels := (Height - GapTop - GapBottom) / (FYScale.ValGap);
   Start := Point(GapLeft, Height - GapBottom);
   Radian := (FXScale.ValMin) * PI;
   Interval := (FXScale.ValMax + FXScale.ValMin) * PI / 144;

   for i:= 0 to High(FPoints) do
   begin
     FPoints[i].X := Start.X + round(Radian * xRangePixels / Pi);
     FPoints[i].Y := Start.Y - round(sin(Radian) * yRangePixels);
     Radian := Radian + Interval;
   end;
   Canvas.Pen.Color := cllime;
   Canvas.Polyline(FPoints);
end;
Miniaturansicht angehängter Grafiken
komponente.jpg  
Christian
  Mit Zitat antworten Zitat