Reputation: 53
I am working on a simple coloring book for children with physical limitations. Teachers will be able to insert a picture in the program composed of only closed areas. I then need to analyze the image and find all closed areas (the places the child will be able to color). I need to do this because all areas that can be painted will glow up one after the other. I think I can accomplish this with a floodfill so I need a point (X,Y coordinate) inside every closed area.
Anyone ever did something like this? Some tips or source code available?
Many thanks!
Upvotes: 0
Views: 1081
Reputation: 14561
I don't have much experience with WPF per se, but I would probably use an algorithm like this:
First, I am assuming the image is strictly monochrome. That is, there are only pure black (line) and pure white (colourable area) pixels.
Now, every area in the image has a different colour.
Upvotes: 2