[fpc-pascal] fpcanvas and FloodFill()

Michael Van Canneyt michael at freepascal.org
Mon Jul 2 14:10:48 CEST 2007

On Mon, 2 Jul 2007, Graeme Geldenhuys wrote:

> On 02/07/07, Michael Van Canneyt <michael at freepascal.org> wrote:
> >
> > The FPImagecanvas has it implemented, you should be able to get some
> > inspiration
> > from that. Look also in the pixtools unit.
> Thanks Michael.
> The hard bit (without looking at any code) will be the rules when to paint.
> Am I understanding FloodFill() correctly.  For example:
> If we have a Canvas with shapes painted on it.  The inside of a
> rectangle might have the same background color as the canvas, but we
> don't want to paint inside the rectangle as it is a closed shape.
> Then we might have a another shape with a outline, but the shape isn't
> closed (end points of polygon doesn't meet up), so we still need to
> paint inside it.


> This is going to be fun.  I'll have a look at those units you mentioned.

Pixtools should have a fully functional version. 
It just needs to be able to retrieve pixel colors.

> So far I have implement about 70% of TFPCustomCanvas in my new fpGUI
> framework. I've also completed Canvas.Pen, Canvas.Brush and
> Canvas.Font support.  All under X11 only, but now that I know what to
> do, GDI should hopefully go quicker.

No-one promised an easy ride ;-)

if you have questions, don't hesitate to bug me.


More information about the fpc-pascal mailing list