public static FloodFill ( |
||
image | 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 | |
Résultat |
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);
}