// 划分像素值,并将八方向的像素放入队列准备划分 private static void SetGather(int x, int y, int id) { Color color = _image.GetPixel(x, y); TextureGather textureGather = GetGather(id); textureGather.AddPixel(new Position(x, y), color); PushToQueue(x + 1, y); PushToQueue(x - 1, y); PushToQueue(x, y + 1); PushToQueue(x, y - 1); PushToQueue(x + 1, y + 1); PushToQueue(x - 1, y - 1); PushToQueue(x + 1, y - 1); PushToQueue(x - 1, y + 1); }