示例#1
0
        public Point?[] SeatchImages(Bitmap[] _Searchfor, out string result, ImageSearchMethode imageSearchMethode, int toleranz = 0, bool jointhread = true)
        {
            var f  = 0;
            var a  = _Searchfor.Length;
            var dt = DateTime.Now;

            SeatchInBitmap      = CaptureScreen();
            _imageSearchMethode = imageSearchMethode;
            _toleranz           = toleranz;
            _joinThread         = jointhread;

            var Presults = new Point?[a];

            var tmp = ctor;

            if (tmp == false)
            {
                ctor = true;
            }

            for (var i = 0; i < a; i++)
            {
                Seatch();

                Presults[i] = _point;
            }

            ctor = tmp;

            result = $"Found {f} from {a} images. TimeSpan:{( DateTime.Now - dt )}";

            return(Presults);
        }
示例#2
0
        public ImageSearch(Bitmap seatchForBitmap, Bitmap seatchInBitmap, ImageSearchMethode imageSearchMethode,
                           bool joinThread = true, int toleranz = 10)
        {
            ctor = true;

            _seatchForBitmap    = seatchForBitmap ?? throw new ArgumentNullException(nameof(seatchForBitmap));
            _seatchInBitmap     = seatchInBitmap ?? throw new ArgumentNullException(nameof(seatchInBitmap));
            _imageSearchMethode = imageSearchMethode;
            _joinThread         = joinThread;
            _toleranz           = toleranz;
        }
示例#3
0
        public bool SeatchImage(Bitmap _Searchin, Bitmap _Searchfor, ImageSearchMethode imageSearchMethode, int toleranz = 0, bool jointhread = true)
        {
            _seatchForBitmap    = _Searchfor;
            _seatchInBitmap     = _Searchin;
            _imageSearchMethode = imageSearchMethode;
            _toleranz           = toleranz;
            _joinThread         = jointhread;

            var tmp = ctor;

            if (tmp == false)
            {
                ctor = true;
            }
            Seatch();
            ctor = tmp;

            return(_found);
        }
示例#4
0
        public string SeatchImageWithInfo(Bitmap _Searchin, Bitmap _Searchfor, ImageSearchMethode imageSearchMethode, int toleranz = 0, bool jointhread = true)
        {
            _seatchForBitmap    = _Searchfor;
            _seatchInBitmap     = _Searchin;
            _imageSearchMethode = imageSearchMethode;
            _toleranz           = toleranz;
            _joinThread         = jointhread;

            var tmp = ctor;

            if (tmp == false)
            {
                ctor = true;
            }
            Seatch();
            ctor = tmp;

            return($"Seatch returned: {_found},  X={_point.X}, Y={_point.Y}, TimeSpan={_timeSpan}");
        }
示例#5
0
 public bool ImageIsOnScreen(Bitmap _Searchfor, ImageSearchMethode imageSearchMethode)
 {
     return(SeatchImage(CaptureScreen(), _Searchfor, imageSearchMethode));
 }