public static Point PositionOf(FastBitmap bmp, Point start, ColorRange range, Rectangle subRect) { for (int y = start.Y; y <= subRect.Height; y++) { for (int x = start.X; x <= subRect.Width; x++) { if (range.HasArgb(bmp[x, y])) { return(new Point(x, y)); } } } return(Point.Empty); }
/// <summary> /// Finds the first occurence of any color in given range and returns its position. /// </summary> /// <param name="bmp"></param> /// <param name="range"></param> /// <returns>Returns the point where color was found; Point.Empty otherwise.</returns> public static Point PositionOf(FastBitmap bmp, ColorRange range) { for (int y = 0; y < bmp.Height; y++) { for (int x = 0; x < bmp.Width; x++) { if (range.HasArgb(bmp[x, y])) { return(new Point(x, y)); } } } return(Point.Empty); }
public static Point PositionOf(FastBitmap bmp, Point start, ColorRange range, Rectangle subRect) { for (int y = start.Y; y <= subRect.Height; y++) { for (int x = start.X; x <= subRect.Width; x++) { if (range.HasArgb(bmp[x, y])) return new Point(x, y); } } return Point.Empty; }
/// <summary> /// Finds the first occurence of any color in given range and returns its position. /// </summary> /// <param name="bmp"></param> /// <param name="range"></param> /// <returns>Returns the point where color was found; Point.Empty otherwise.</returns> public static Point PositionOf(FastBitmap bmp, ColorRange range) { for (int y = 0; y < bmp.Height; y++) { for (int x = 0; x < bmp.Width; x++) { if (range.HasArgb(bmp[x, y])) return new Point(x, y); } } return Point.Empty; }