示例#1
0
        Point GetSquareCoordinate(CustomBitmap i)
        {
            for (int x = 0; x < i.Width; x++)
            {
                for (int y = 0; y < i.Height; y++)
                {
                    var color = i.GetPixel(x, y);
                    if (color == 1)
                    {
                        return(new Point(x, y));
                    }
                }
            }

            throw new NoSquareFound(i);
        }
示例#2
0
 public NoSquareFound(CustomBitmap image) : base("No square found in image.")
 {
     this.image = image;
 }