Пример #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);
            }));
        }
Пример #2
0
        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));
        }
Пример #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));
        }
Пример #4
0
 public static IPattern GetCopy(Region Region) => ScreenshotManager.GetScreenshot()
 .Crop(Region.TransformToImage())
 .Copy();