Example #1
0
        /// <summary>
        /// 查找指定区域内的所有颜色,颜色格式"RRGGBB-DRDGDB",注意,和按键的颜色格式相反
        /// </summary>
        /// <param name="dmsoft"></param>
        /// <param name="findColor"></param>
        /// <returns></returns>
        public static List <Point> FindColorEx(this dmsoft dmsoft, FindColorEx findColor)
        {
            List <Point> points = new List <Point>();
            string       s = dmsoft.FindColorEx(findColor.X1, findColor.Y1, findColor.X2, findColor.Y2, findColor.Color, findColor.Sim, findColor.Dir);
            int          x, y;
            int          index = 0;
            int          count = dmsoft.GetResultCount(s);

            while (index < count)
            {
                dmsoft.GetResultPos(s, index++, out x, out y);
                points.Add(new Point(x, y));
            }
            return(points);
        }