procedure TGraph.PrepareScale;
var
gray: Integer;
begin
If ScaleMax = 0
Then
ScaleMax := 1;
Aspect := Image.Width / Image.Height;
yMin := -ScaleMax;
yMax := ScaleMax;
xMin := -ScaleMax * Aspect;
xMax := ScaleMax * Aspect;
Bo := 20;
BoLeft := Bo;
BoTop := Bo;
BoRight := Bo;
BoBottom := Bo;
Fact;
Image.Canvas.brush.Color := $00E0FFFF;
// Hintergrund löschen
Image.Canvas.FillRect(Image.Canvas.ClipRect);
gray := 200;
gray :=
RGB(gray, gray, gray);
Image.Canvas.Pen.Color := gray;
// Koordinatenkreuz
Image.Canvas.Pen.Mode := pmNotXor;
Image.Canvas.MoveTo(xxc(xMin), yyc(0));
Image.Canvas.LineTo(xxc(xMax), yyc(0));
Image.Canvas.MoveTo(xxc(0), yyc(yMin));
Image.Canvas.LineTo(xxc(0), yyc(yMax));
// Brush löschen
Image.Canvas.Brush.Style:= bsClear;
// Kreis zeichnen
DrawEllipseFromCenter(Image.Canvas, xxc(Physics.x0), yyc(Physics.y0), trunc(xFact * Physics.L0));
Image.Canvas.Pen.Color := clblack;
//Rechteck von links oben nach rechts unten
Image.Canvas.Rectangle(xxc(xMin), yyc(yMin), xxc(xMax), yyc(yMax));
end;