//IMG OpenCV public void Tap_Img(string deviceID, Bitmap ImgFind) { Bitmap bm = (Bitmap)ImgFind.Clone(); var screen = ADBHelper.ScreenShoot(deviceID); var Point = ImageScanOpenCV.FindOutPoint(screen, bm); if (Point != null) { ADBHelper.Tap(deviceID, Point.Value.X, Point.Value.Y); return; } //MessageBox.Show("Tìm không ra"); }
private static System.Drawing.Point?GetPoint(string id, Bitmap img) { var screen = ADBHelper.ScreenShoot(id, false); Bitmap tmp_img = (Bitmap)img.Clone(); Bitmap tmp_scr = (Bitmap)screen.Clone(); var point = ImageScanOpenCV.FindOutPoint(tmp_scr, tmp_img); return(point); //var aa = ImageScanOpenCV.Find(screen, D_FLAG); //if (aa != null) //{ // aa.Save("aaa.png"); //} }
private static string CheckImage(string id, Bitmap img) { //Task l = new Task(() => //{ //while (true) //{ var screen = ADBHelper.ScreenShoot(id); var point = ImageScanOpenCV.FindOutPoint(screen, img); var aa = ImageScanOpenCV.Find(screen, img); aa.Save("aaa.png"); if (point != null) { //Dispatcher.BeginInvoke(new ThreadStart(() => rtb1.AppendText("Home!!!"))); //break; return("find!"); } return(""); //} //}); //l.Start(); }