示例#1
0
        /// <summary>
        /// 查找指定区域内的图片,位图必须是24位色格式,支持透明色,当图像上下左右4个顶点的颜色一样时,则这个颜色将作为透明色处理.
        /// 这个函数可以查找多个图片,并且返回所有找到的图像的坐标.此函数同FindPicEx.只是返回值不同.
        /// </summary>
        /// <param name="dmsoft"></param>
        /// <param name="findColor"></param>
        /// <returns>(由于内存限制,返回的图片数量最多为1500个左右)</returns>
        public static List <Point> FindPicExS(this dmsoft dmsoft, FindPicExS findColor)
        {
            List <Point> points = new List <Point>();
            string       s = dmsoft.FindPicExS(findColor.X1, findColor.Y1, findColor.X2, findColor.Y2, findColor.PicName, findColor.DeltaColor, 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);
        }