Algorithmix.Preprocessing.Preprocessing.FloodFill C# (CSharp) Метод

FloodFill() публичный статический Метод

Flood fill in a BFS manner, so as not to overwhelm the stack
public static FloodFill ( Bitmap image, int xpixel, int ypixel, double threshold, Bgr myColor ) : Bitmap
image System.Drawing.Bitmap the image we wish to fill on
xpixel int the x pixel to sample from
ypixel int the y pixel to sample from
threshold double the threshold of difference
myColor Bgr
Результат System.Drawing.Bitmap
        public static Bitmap FloodFill(Bitmap image, int xpixel, int ypixel, double threshold, Bgr myColor)
        {
            AForge.Imaging.Filters.PointedColorFloodFill filter = new PointedColorFloodFill();
            int thresh = (int)threshold;
            filter.Tolerance = Color.FromArgb(thresh, thresh, thresh);
            filter.FillColor = Color.Black;
            filter.StartingPoint = new IntPoint(xpixel, ypixel);
            Bitmap dotjpg = AForge.Imaging.Image.Clone(image, PixelFormat.Format24bppRgb); //force the jpgs
            return filter.Apply(dotjpg);
        }