Delphi - 带渐变的洪水填充?
有没有办法在 D2007 中使用 Canvas.FloodFill 用渐变颜色填充自定义形状的对象。从白色变为边框颜色。 我无法用谷歌搜索到任何有用的东西。
或者只是用渐变颜色填充自定义形状的对象的任何其他方式?
谢谢。
Is there a way to use Canvas.FloodFill in D2007 to fill a custom shaped object with gradient colors. Going from white to a border color.
I couldn't google out anything useful.
Or just any other way of filling a custom shaped object with gradient colors?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不这么认为。
洪水填充采用当前画笔颜色设置的任何内容,在洪水填充期间您无法更改它。
但是,您可以使用洪水填充将颜色设置为图像中尚未存在的颜色,然后循环像素,检查像素的颜色,并以这种方式进行渐变填充。这将为您处理边界检测。
I don't think so.
Floodfill takes uses whatever the current brush color is set to, you can't change it during the flood fill.
You could however use floodfill to set the color to something not already in the image, then loop over the pixels, check for that color of the pixel, and do a gradient fill that way. That would take care of the boundary detection for you.
您检查过 GDI+ 了吗?您可以制作形状(路径)并使用 GDI+ 对其进行渐变填充。有一些适用于 GDI+ 的 Delphi-Wrappers 并附有示例:
这是一个起点:
http://www .bilsen.com/gdiplus/index.shtml
Have you checked GDI+ already? You can make Shapes (Pathes) and gradient-fill them with GDI+. There are some Delphi-Wrappers around for GDI+ with examples:
Here is a starting point:
http://www.bilsen.com/gdiplus/index.shtml