Exemple #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);
            }));
        }
        static bool ExistsNow(Region Region, IPattern Image, double?Similarity)
        {
            var sshot = ScreenshotManager.GetScreenshot();

            if (Region != null)
            {
                sshot = sshot.Crop(Region.TransformToImage());
            }

            return(sshot
                   .IsMatch(Image, Similarity ?? MinSimilarity));
        }
Exemple #3
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));
        }
 public static IPattern GetCopy(Region Region) => ScreenshotManager.GetScreenshot()
 .Crop(Region.TransformToImage())
 .Copy();