Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker!bloom-beacon!eru!hagbard!sunic!news.funet.fi!uwasa.fi!ts From: ts@uwasa.fi (Timo Salmi) Newsgroups: comp.lang.pascal Subject: Re: TP5.5 FloodFill Message-ID: <1990Sep30.063652.10640@uwasa.fi> Date: 30 Sep 90 06:36:52 GMT References: <1990Sep29.202750.7797@uwasa.fi> Organization: University of Vaasa Lines: 34 In article clong@remus.rutgers.edu (Chris Long) writes: >In article <1990Sep29.202750.7797@uwasa.fi>, Timo Salmi writes: > >> There is a simple trick to test the fill locig. Replace FloodFill >> (temporarily) with PutPixel so that you can ascertain that your fill >> seed is properly placed. > >The seeds are properly placed. Is it the case that FloodFill only >fills over the background? If so, no mention of this is made in the >reference guide. In using FloodFill there are three aspects to consider. The first is the borderline color, which defines the area to be filled. The second is the actual fill color which is allowed to be different from the borderline color. The third consideration is the pattern of the fill (it is best first to test with SolidFill). As to the location of seeds, note that if the seed falls on the border, you may not get a fill. The other problem is that if your border is broken (that is you eg cross it by a line) FloodFill will leak all over the screen. I'm using TP 5.0 myself, but (so far) I have not come upon any instances where the fill system fails to work for reasons other than failings in my own logic. Finally, here is an (on the fly) example of one sequence that fills a circle SetColor (YourBorderColor); Circle (Your_x, Your_y, Your_r); SetFillStyle (SolidFill, YourFillColor); FloodFill (Your_x, Your_y, YourBorderColor); ................................................................... Prof. Timo Salmi (Moderating at anon. ftp site 128.214.12.3) School of Business Studies, University of Vaasa, SF-65101, Finland Internet: ts@chyde.uwasa.fi Funet: gado::salmi Bitnet: salmi@finfun