AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Multimedia FMX bunte Polygone zeichnen
Thema durchsuchen
Ansicht
Themen-Optionen

FMX bunte Polygone zeichnen

Ein Thema von bernhard_LA · begonnen am 18. Aug 2020 · letzter Beitrag vom 18. Aug 2020
 
bernhard_LA

Registriert seit: 8. Jun 2009
Ort: Bayern
1.138 Beiträge
 
Delphi 11 Alexandria
 
#1

FMX bunte Polygone zeichnen

  Alt 18. Aug 2020, 08:23
scheitere aktuell dabei jetzt bunte Polygone zu zeichnen


hier der Demo code :


Delphi-Quellcode:
procedure TForm1.btn_draw_PolygonClick(Sender: TObject);
var
  p1, p2, p3, p4, p5: TPointF;
  MyPolygon: TPolygon;
  I: Integer;
  Brush: TStrokeBrush;
begin


  for I :=1 to 10 do
  begin
  Brush := TStrokeBrush.Create(TBrushKind.Solid, randomColor);
  Brush.Thickness := 2;
  // sets the points that define the polygon
  p1 := TPointF.Create(200+ Random(50), 220 + Random(50) );
  p2 := TPointF.Create(250+ Random(50), 360+ Random(50));
  p3 := TPointF.Create(280+ Random(50), 260+ Random(50));
  p4 := TPointF.Create(200+ Random(50), 180+ Random(50));
  p5 := TPointF.Create(100+ Random(50), 160+ Random(50));
  // creates the polygon
  SetLength(MyPolygon, 5);
  MyPolygon[0] := p1;
  MyPolygon[1] := p2;
  MyPolygon[2] := p3;
  MyPolygon[3] := p4;
  MyPolygon[4] := p5;

  // localBMP.Canvas.Stroke := Brush; geht nicht weil read only property ......

  localBMP.Canvas.BeginScene;
  // draws the polygon on the canvas
  localBMP.Canvas.DrawPolygon(MyPolygon, 50) ;
  localBMP.Canvas.EndScene;
  // updates the bitmap
  // Image1.Bitmap.BitmapChanged;

  LoadBMP2GUI(nil);

  Brush.Free;
  end;
end;

ich kann den Brush nicht an meine Bitmap übergeben , und einen Aufruf incl. Brush gibt es für Canvas.DrawPolygon nicht
Angehängte Grafiken
Dateityp: jpg random_polygon.JPG (44,8 KB, 12x aufgerufen)

Geändert von bernhard_LA (18. Aug 2020 um 08:27 Uhr)
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 07:33 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz