Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Fill function

Hi, I'm looking for C (preferably Borland) code that will be used to handle the operation of the standard fill tool on an art program (filling an area with a color).
Borland's floodfill function fills an area until it encounters only a certain color, whereas most drawing programs have fill tools that fill an area until they reach ANY OTHER color than that of the pixel on which they were first clicked. Can anyone help me find the code I'm looking for? Thanks.

Comments

  • Josh CodeJosh Code Member Posts: 675
    [b][red]This message was edited by Josh Code at 2002-8-29 15:8:46[/red][/b][hr]
    : Hi, I'm looking for C (preferably Borland) code that will be used to handle the operation of the standard fill tool on an art program (filling an area with a color).
    : Borland's floodfill function fills an area until it encounters only a certain color, whereas most drawing programs have fill tools that fill an area until they reach ANY OTHER color than that of the pixel on which they were first clicked. Can anyone help me find the code I'm looking for? Thanks.
    :

    I am using Delphi's help on FloodFill and I found this:
    [italic]
    FillStyle determines what type of color changes define the boundaries, as indicated in the following table.

    [b]Value Meaning[/b]
    [hr]
    fsSurface Fill all area that has the color indicated by the Color parameter. Stop when another color is encountered.

    fsBorder Fill all area that does not have the color indicated by the Color parameter. Stop when Color is encountered.
    [/italic]

    It looks to me like all you have to do is use the fsSurface fillstyle and you will get what you want. Usually functions like that are the same in C++ Builder and Delphi, so you should try that out.



  • Chris BrownChris Brown USAMember Posts: 4,496 ✭✭

    _ [ http://forcoder.org ] free ebooks and video tutorials about [ C, Python, PHP, Scratch, Assembly, Delphi, C#, Visual Basic .NET, Swift, Perl, Java, R, Go, PL/SQL, C++, Objective-C, MATLAB, Visual Basic, JavaScript, Ruby Erlang, Julia, VBScript, Apex, LabVIEW, Kotlin, D, Lua, Fortran, Dart, Alice, Hack, Lisp, Logo, Ada, Prolog, F#, ML, Awk, COBOL, Rust, Scala, Transact-SQL, Crystal, Bash, Clojure, ABAP, SAS, Scheme, FoxPro ] ____________

Sign In or Register to comment.