Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Floodfill (https://www.delphipraxis.net/154289-floodfill.html)

1234567890987654321 4. Sep 2010 11:24

Floodfill
 
Hallo, wenn ich eine Fläche mit Floodfill füllen will, beutze ich diesen Code:
Code:
  Image1.Picture.Bitmap.Canvas.Brush.Color:=Colordialog1.Color;
 image1.Picture.Bitmap.Canvas.FloodFill(x div 10,y div 10, ColorDialog1.Color, fsBorder);
Das funktionirt auch, wenn die Begrenzung die gleiche Farbe hatt, wie die Füllfarbe.
Wenn die Füllfarbe aber Rot ist, und die Begrenzungs-Farbe Schwarz, wird das ganze Image Rot.

Vielen Danke für Antworten

Sir Rufo 4. Sep 2010 11:41

AW: Floodfill
 
Lies mal hier
speziell den Satz
Zitat:

The following code flood-fills, from the center point of Form1's client area, until the color black is encountered.
Also gib als Parameter die Begrenzungsfarbe (in deinem Beispiel clBlack) mit und schon wird es gehen

1234567890987654321 4. Sep 2010 11:47

AW: Floodfill
 
Und was ist bei mehreren Begrenzungsfarben?

Sir Rufo 4. Sep 2010 11:51

AW: Floodfill
 
Zitat:

Zitat von 1234567890987654321 (Beitrag 1047469)
Und was ist bei mehreren Begrenzungsfarben?

FloodFill kann eine Fläche bis zu einer Begrenzungsfarbe füllen.
Also kannst du dafür wohl FloodFill nicht benutzen
Somit bleibt nur selber bauen oder suchen ... (ich habe keine :mrgreen: )

PS: Wenn die zu füllende Fläche einen einheitlichen Farbwert hat, dann kann man diese wie folgt füllen:
Delphi-Quellcode:
Canvas.FloodFill(x div 10,y div 10, clWhite, fsSurface);


Alle Zeitangaben in WEZ +1. Es ist jetzt 16:32 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