Hey all you GDI+ gurus,
Im trying to define a region based on the results of a floodfill. The user draws freeform on a picturebox, then clicks in any enclosed area. I can fill the enclosed area rapidly just fine. However, I now want to define a region based on what was filled.
One idea was to collect the points during the floodfill that are on the original path. While this is slow, its even slower trying to rearrange the resulting collection of points into a new path (the collection is in a pseudo-random order). Another idea is to collect the points in the path that enclose the selected point, define that as a region, and just do a FillRegion. However, sometimes the region is not bordered by a path but by another region of another color.
Is it possible to collect all points that are filled, then define a region that encloses all those points? I dont think RegionData works for this.
Any help (in VB.Net) would be greatly appreciated!
Larry
Im trying to define a region based on the results of a floodfill. The user draws freeform on a picturebox, then clicks in any enclosed area. I can fill the enclosed area rapidly just fine. However, I now want to define a region based on what was filled.
One idea was to collect the points during the floodfill that are on the original path. While this is slow, its even slower trying to rearrange the resulting collection of points into a new path (the collection is in a pseudo-random order). Another idea is to collect the points in the path that enclose the selected point, define that as a region, and just do a FillRegion. However, sometimes the region is not bordered by a path but by another region of another color.
Is it possible to collect all points that are filled, then define a region that encloses all those points? I dont think RegionData works for this.
Any help (in VB.Net) would be greatly appreciated!
Larry