Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        /// <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);
        }
Ejemplo n.º 3
0
        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;
        }
Ejemplo n.º 4
0
        /// <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;
        }