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

自闭症网瘾萝莉.ら 提交于 2019-12-18 07:19:00

问题


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


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/4230764/quickfill-flood-fill-algorithm-in-c-vb-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!