QuickFill/洪水填充算法 [英] QuickFill/flood fill algorithm

查看:118
本文介绍了QuickFill/洪水填充算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一种泛洪填充算法,以各种颜色和填充图案填充现有的栅格形状.据我所知,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.

如果需要其他实现,则有两个代码项目文章 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.

如果您想深入学习并学习代码,则可以使用 Paint .Net 项目,该项目具有出色的洪水填充实施方案.

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

这篇关于QuickFill/洪水填充算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆