public static SearchResult[] SearchBitmap(Bitmap searchForFile, Image searchOn, Rectangle searchForBounds,
                                                  Rectangle searchArea, double tolerance)
        {
            if (searchArea.Width <= 0 || searchArea.Height <= 0)
            {
                searchArea = new Rectangle(0, 0, searchOn.Width, searchOn.Height);
            }
            //创建小图标
            Bitmap searchFor = null;
            var    rect      = new Rectangle(
                searchForBounds.X,
                searchForBounds.Y,
                searchForBounds.Width == 0 ? searchArea.Width - 1 : searchForBounds.Width,
                searchForBounds.Height == 0 ? searchArea.Height - 1 : searchForBounds.Height);

            searchFor = searchForFile.Clone(rect, searchForFile.PixelFormat);

            var search  = new BitmapSearch(searchOn as Bitmap);
            var results = search.FindAll(searchFor, searchArea, GeometryHelper.Center(searchArea), 50,
                                         (int)(tolerance * 100));

            var list = new List <SearchResult>();

            foreach (var item in results)
            {
                list.Add(new SearchResult(item, 1.0));
            }
            list.Sort();
            return(list.ToArray <SearchResult>());
        }
        public static Rectangle[] SearchBitmap(Bitmap screen, Bitmap searchFor, Rectangle searchArea, Point startFrom,
                                               int maxCount, int tolerance)
        {
            var search = new BitmapSearch(screen);

            return(search.FindAll(searchFor, searchArea, startFrom, maxCount, tolerance));
        }
        public static SearchResult[] SearchBitmap_Test(Bitmap searchFor, Bitmap searchOn, double tolerance)
        {
            var searchArea = new Rectangle(0, 0, searchOn.Width, searchOn.Height);
            var search     = new BitmapSearch(searchOn);
            var results    = search.FindAll(searchFor, searchArea, GeometryHelper.Center(searchArea), 50,
                                            (int)(tolerance * 100));

            var list = new List <SearchResult>();

            foreach (var item in results)
            {
                list.Add(new SearchResult(item, 1.0));
            }
            list.Sort();
            return(list.ToArray <SearchResult>());
        }