void Fill(Point p, Bitmap ffBm) { //if (bm.GetPixel(p.X, p.Y).ToArgb() == c.ToArgb()) // return; floodFillPoint = p; foreach (List <bool> x in processed) { x.Clear(); } processed.Clear(); for (int i = 0; i < bm.Width; ++i) { processed.Add(new List <bool>(Enumerable.Repeat(false, bm.Height))); } floodFillData = new LockBitmap(floodFillPicture); floodFillData.LockBits(); bmData = new LockBitmap(bm); bmData.LockBits(); FillNested(p, GetRelativeFloodFillPixel, bmData.GetPixel(p.X, p.Y)); bmData.UnlockBits(); floodFillData.UnlockBits(); paintWind.Invalidate(); }
void Fill(Point p, Color c) { if (bm.GetPixel(p.X, p.Y).ToArgb() == c.ToArgb()) { return; } foreach (List <bool> x in processed) { x.Clear(); } processed.Clear(); for (int i = 0; i < bm.Width; ++i) { processed.Add(new List <bool>(Enumerable.Repeat(false, bm.Height))); } bmData = new LockBitmap(bm); bmData.LockBits(); FillNested(p, (x, y) => c, bmData.GetPixel(p.X, p.Y)); bmData.UnlockBits(); paintWind.Invalidate(); }