Android Скриншот ADB напрямую с устройства на P C C# - PullRequest
0 голосов
/ 05 мая 2020

Я хочу сделать снимок экрана с моего Android устройства прямо на t P C Без сохранения на Android устройстве ...

в строке cmd с ADB.exe он работает с этим:

adb exe c -out screencap -p> C: \ Users \ simon \ Desktop \ testadb \ test3.png

Теперь я программирую в C# GUI в Visual 2019 ...

это выглядит так:

private void testscreenshot_Click(object sender, RoutedEventArgs e)
        {
            Process testsc = new Process();
            ProcessStartInfo info = new ProcessStartInfo();

            info.WindowStyle = ProcessWindowStyle.Hidden;
            info.CreateNoWindow = true;
            info.UseShellExecute = false;
            info.RedirectStandardOutput = true;
            info.RedirectStandardInput = true;

            int xs = Convert.ToInt32(xstart.Text);
            int xe = Convert.ToInt32(xend.Text);
            int ys = Convert.ToInt32(ystart.Text);
            int ye = Convert.ToInt32(yend.Text);
            int t = Convert.ToInt32(time.Text);


            info.FileName = "adb.exe";
            info.Arguments = "adb exec-out screencap -p > C:\\simon\\phoj\\Desktop\\testadb\\testxx.png";
            testsc.StartInfo = info;

            testsc.Start();

            message.Text += "screesnshotxx " + testsc.StandardOutput.ReadToEnd();

но это не работает .... что я делаю не так?

Я программист-новичок, я знаю, и надеюсь, что кто-нибудь может мне помочь .....

...