示例#1
0
        public static Point FindGamePictureDuring(Rect rect, GamePicture picture, int ms, int maxcount)
        {
            var path = GetPicturePath(picture);

            if (!File.Exists(path))
            {
                return(new Point(-2, -2));
            }

            int count = 0;

            while (count < maxcount)
            {
                string[] search = ImageSearcher.Search(path);
                if (search == null)
                {
                    count++;
                    Thread.Sleep(ms);
                    continue;
                }
                int[] search_ = new int[search.Length];
                for (int j = 0; j < search.Length; j++)
                {
                    search_[j] = Convert.ToInt32(search[j]);
                }
                return(new Point(search_[1], search_[2]));
            }

            return(new Point(-1, -1));
        }
示例#2
0
        public static Point FindGamePicture(GamePicture picture)
        {
            var path = GetPicturePath(picture);

            if (!File.Exists(path))
            {
                return(new Point(-2, -2));
            }
            string[] search = ImageSearcher.Search(path);
            if (search == null)
            {
                return(new Point(-1, -1));
            }
            int[] search_ = new int[search.Length];
            for (int j = 0; j < search.Length; j++)
            {
                search_[j] = Convert.ToInt32(search[j]);
            }
            return(new Point(search_[1], search_[2]));
        }