Einzelnen Beitrag anzeigen

EWeiss
(Gast)

n/a Beiträge
 
#5

AW: Zeichnen auf Canvas und ZOrder bzw. Übermalen

  Alt 2. Apr 2015, 06:22
Hast du mal Pen.Mode mal eingestellt?
Delphi-Quellcode:
begin
  with canvas do
  begin
    Pen.Width := 5;
    Pen.Mode := pmMergePenNot; //<<<---

    Brush.Color := clRed;
    Brush.Style := bsSolid;

    MoveTo(0, 0);
    LineTo(200, 200);

    Ellipse(0, 0, 200, 200);
  end;
end;
Werde das mal mit dem alten Projekt testen.
Habe es jetzt auf GDI+ umgestellt.

Delphi-Quellcode:
procedure TGraph.Draw;
begin
  PrepareScale;

  graphics := TGPGraphics.Create(Bitmap.Canvas.Handle);
  graphics.SetSmoothingMode(SmoothingModeAntiAlias);

  Pen := TGPPen.Create(MakeColor(255, 0, 0, 0));
  path := TGPGraphicsPath.Create;
  brush := TGPSolidBrush.Create(MakeColor(255, 0, 0, 0));

  // Pendel Linie
  If Physics.D <> 0 then
    graphics.DrawLine(Pen, xxc(Physics.x0), yyc(Physics.y0), xxc(Physics.x1), yyc(Physics.y1));

  // Pendel Center Punkt
  DrawEllipseFromCenter(path, xxc(Physics.x0), yyc(Physics.y0), round(Physics.r0 * xFact));

  graphics.DrawPath(pen, path);
  graphics.FillPath(brush, path);

  // Pendel (Ball)
  path.Reset;
  Pen.SetColor(MakeColor(255, 0, 0, 0));
  brush.SetColor(MakeColor(255, 255, 0, 0));

  DrawEllipseFromCenter(path, xxc(Physics.x1), yyc(Physics.y1), round(Physics.r1 * xFact));

  graphics.DrawPath(pen, path);
  graphics.FillPath(brush, path);

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

  Pen.Free;
  path.Free;
  brush.Free;
  graphics.Free;
end;
Damit geht es wie es soll.. Qualität siehe Anhang.
Danke!

gruss

Geändert von EWeiss (11. Jul 2019 um 15:43 Uhr)
  Mit Zitat antworten Zitat