Exemplo n.º 1
0
        public void GetCaptorTest()
        {
            var captor = CaptorFactory.GetCaptor();

            using var data = captor.CaptureScreen();
            Assert.IsNotNull(data);
            Cv2.ImShow("捕获内容", data);
            Cv2.WaitKey(2000);
            Cv2.DestroyAllWindows();
        }
Exemplo n.º 2
0
        /// <summary>
        ///     搜索控件
        /// </summary>
        /// <param name="matchResult"></param>
        /// <returns></returns>
        public bool Search(out FeatureMatchResult matchResult)
        {
            matchResult = null;
            var captor = CaptorFactory.GetCaptor();

            using var captureWindow = IsSearchScreen ? captor.CaptureScreen() : captor.CaptureWindow(_windowHandle);

            foreach (var searchMat in _searchMats)
            {
                matchResult = CvMatch.FeatureMatch(captureWindow, searchMat, FeatureMatchType.Sift, MatchArgument);
                if (matchResult.Success)
                {
                    return(true);
                }
            }

            return(false);
        }