Einzelnen Beitrag anzeigen

Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#4

AW: Polygon schraffieren ohne Brush.Style

  Alt 7. Jun 2016, 09:11
Ich meine sowas:
Delphi-Quellcode:
var bmp: TBitmap;
    metafile: TMetafile;
    metaFileCanvas: TMetafileCanvas;
begin
  metafile := TMetafile.Create;
  metafile.Transparent := True;
  metaFileCanvas := TMetafileCanvas.Create(metafile, 0);

  bmp := TBitmap.Create;
  try
    bmp.Width = 500; // Oder wie groß auch immer
    bmp.Height = 500;
    
    // Polygon mit Schraffur zeichnen
    bmp.Canvas.Brush.Color := clRed;
    bmp.Canvas.Brush.Style := bsCross;
    bmp.Canvas.Polygon([Point(12,2), Point(50,70), Point(150,320), Point(30,90)]);

    metaFileCanvas.Draw(0, 0, bmp); // Bitmap mit Polygon auf Metafilecanvas übertragen.
  finally
    bmp.Free;
  end;
end;
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
  Mit Zitat antworten Zitat