QuickFill/flood fill algorithm in C#/VB.NET

2020-02-13 04:23发布

I need a flood fill algorithm to fill existing raster shapes with various colors and fill patterns. From what I know, the QuickFill algorithm is the best way to do a flood fill. I've found a number of implementations, but they are all in C++ and use Windows SDK functions. The problem is that I need a .NET implementation.

If worse comes to worse I can write a new implementation, but I would rather use an existing implementation (that hopefully doesn't have bugs). Is anyone aware of an existing flood fill implementation in C#/VB.NET?

Thanks, Erick

2条回答
ら.Afraid
2楼-- · 2020-02-13 05:04

I like a lot to work with the Aforge Library that has two good FlodFill implementations, but both are 4 directional only.

If you need other implementations there exist two code project articles Flood Fill Algorithms in C# and GDI+ and Queue-Linear Flood Fill: A Fast Flood Fill Algorithm.

And if you like to dig in the code and learn, there is the Paint .Net project that has an excelent flood fill implementation.

查看更多
beautiful°
3楼-- · 2020-02-13 05:04

I had a same question a long time ago and I found this

查看更多
登录 后发表回答