Are there any flood fill guru's out there? I need a flood fill type algorithm, that maintains a rectangle aspect... I could solve this using many nested loops checking each pixel - but I need the speed that the native methods provide, and hoping I can achieve it suing Bitmap Data and the flood fill method.
Please check the attached image to see what I mean. Diagrams 1&2 show two different pixel locations, but the end result (3) is the same.
good point, the reason being that it would be to narrow to be useful. I'm attempting to find the bounds of a useful space, so x + y must meet a minimum size otherwise it will exit, ready for a new location to be given.
Running a loop isn't that intensive if you have the bitmap already set up (here's an implementation) - For you though, you probably don't need all that - you could take a 1px tall bitmap of the row you clicked and use getColorBoundsRect in a loop or else just iterate over the pixels manually to find the block of like colors from where the mouse is, then repeat for the column.
Please use [php] or [code] tags, and mark your threads resolved 8)