home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / sonderh1 / floodfil.pas < prev    next >
Pascal/Delphi Source File  |  1987-04-15  |  842b  |  20 lines

  1. (*-------------------------------------------------------------------------*)
  2. (*                           FLOODFIL.PAS                                  *)
  3. (*                Rekursiver Floodfill zum Flaechenfuellen                 *)
  4.  
  5. PROCEDURE Fill (x: x_Koord; y: y_Koord; SperrFarbe: Sys_Colors);
  6.  
  7. BEGIN
  8.   IF NOT GetPixel(x, y, SperrFarbe) THEN
  9.   BEGIN                                   (* KEIN Punkt gesetzt, setzen... *)
  10.     point(x,y);
  11.                                      (* und in alle vier Richtungen gucken *)
  12.     Fill(Succ(x), y, SperrFarbe);
  13.     Fill(Pred(x), y, SperrFarbe);
  14.     Fill(x, Succ(y), SperrFarbe);
  15.     Fill(x, Pred(y), SperrFarbe)
  16.   END
  17. END;
  18.  
  19. (*-------------------------------------------------------------------------*)
  20. (*                          Ende FLOODFIL.PAS                              *)