用C QuickFill /洪水填充算法#/ VB.NET洪水、算法、QuickFill、VB

2023-09-04 00:18:23 作者:愿化蝶纷飞

我需要一个洪水填充算法,以填补现有栅格的形状与各种颜色和填充图案。据我所知,在QuickFill算法是做倾倒填充的最佳途径。我发现了一些实现的,但他们都是在C ++中,并使用Windows SDK的功能。问题是,我需要一个.NET实现。

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.

如果差来差我可以写一个新的实现,但我宁愿使用现有的执行(希望没有错误)。任何人是否知道在C中现有的颜色填充执行#/ VB.NET?

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?

谢谢, 埃里克

推荐答案

我想了很多与 Aforge图书馆工作< /一>,有两个很好的FlodFill实现,但两者都是4个方向而已。

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

如果您需要其他实现存在两个code项目的文章的颜色填充算法在C#和GDI + 和队列线性洪水填充:快速颜色填充算法

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.

如果你喜欢挖code和学习,还有就是涂料净项目有外观极好的洪水填充实现。

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