Einzelnen Beitrag anzeigen

EWeiss
(Gast)

n/a Beiträge
 
#1

Zeichnen auf Canvas und ZOrder bzw. Übermalen

  Alt 2. Apr 2015, 02:36
Kennt der Canvas beim zeichnen keine ZOrder?
Jetzt zeichne ich schon auf ein Bitmap und ist immer noch Müll!
Ich zeichne alles in der richtigen Reihenfolge trotzdem sind die Linien über den Kreisen und nicht drunter.

Delphi-Quellcode:
procedure TGraph.Draw;
begin

  Bitmap.Canvas.Font.Color := clblack;
  Bitmap.Canvas.Pen.Width := 1;
  PrepareScale;

  If Physics.D <> 0 then
  begin
    // Linie an der das Pendel (Ball) hängt
    Bitmap.Canvas.Pen.Color := clblack;
    Bitmap.Canvas.MoveTo(xxc(Physics.x0), yyc(Physics.y0));
    Bitmap.Canvas.LineTo(xxc(Physics.x1), yyc(Physics.y1));
  end;

  Bitmap.Canvas.Brush.Style:= bsSolid;
  Bitmap.Canvas.brush.Color := clblack;
  Bitmap.Canvas.Pen.Width := 5;
  // Center Punkt
  DrawEllipseFromCenter(Bitmap.Canvas, xxc(Physics.x0), yyc(Physics.y0), round(Physics.r0 * xFact));

  // Ball
  Bitmap.Canvas.brush.Color := clred;
  Bitmap.Canvas.Pen.Width := 2;
  DrawEllipseFromCenter(Bitmap.Canvas, xxc(Physics.x1), yyc(Physics.y1), round(Physics.r1 * xFact));

  // vom Bitmap auf das Canvas kopieren
  BitBlt(PaintFrame.Canvas.Handle, 0, 0, Bitmap.Width, Bitmap.Height, Bitmap.Canvas.Handle, 0, 0, srccopy);
end;
gruss

Geändert von EWeiss ( 2. Apr 2015 um 04:03 Uhr)
  Mit Zitat antworten Zitat