开发者

Delphi - floodfill with gradient?

开发者 https://www.devze.com 2023-03-04 15:34 出处:网络
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.

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.


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消