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); }
public NoSquareFound(CustomBitmap image) : base("No square found in image.") { this.image = image; }