Esempio n. 1
0
        public static IEnumerable <Match> FindAll(Region Region, IPattern Pattern, double?Similarity = null)
        {
            var sshot = ScreenshotManager.GetScreenshot();

            if (Region != null)
            {
                if (_platformImpl.DebugMode)
                {
                    Region.Highlight(DefaultHighlightTimeout);
                }

                sshot = sshot.Crop(Region.TransformToImage());
            }

            return(sshot
                   .FindMatches(Pattern, Similarity ?? MinSimilarity)
                   .Select(M =>
            {
                var region = M.TransformFromImage();

                if (Region != null)
                {
                    region.X += Region.X;
                    region.Y += Region.Y;
                }

                return new Match(region, M.Score);
            }));
        }
Esempio n. 2
0
        static bool ExistsNow(Region Region, IPattern Image, double?Similarity)
        {
            var sshot = ScreenshotManager.GetScreenshot();

            if (Region != null)
            {
                if (_platformImpl.DebugMode)
                {
                    Region.Highlight(DefaultHighlightTimeout);
                }

                sshot = sshot.Crop(Region.TransformToImage());
            }

            return(sshot
                   .IsMatch(Image, Similarity ?? MinSimilarity));
        }