void ShrinkBy(BinaryMap temporary, BinaryMap inner, int amount) { temporary.Clear(); temporary.Copy(inner, new RectangleC(amount, 0, inner.Width - amount, inner.Height), new Point(0, 0)); temporary.And(inner, new RectangleC(0, 0, inner.Width - amount, inner.Height), new Point(amount, 0)); temporary.And(inner, new RectangleC(0, amount, inner.Width, inner.Height - amount), new Point(0, 0)); temporary.And(inner, new RectangleC(0, 0, inner.Width, inner.Height - amount), new Point(0, amount)); inner.Copy(temporary); }