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