1 Answer

0 votes
by (5.6k points)

你试试这种方法,这是从pico官方capture screen demo中看到的,你可以去看看
https://github.com/picoxr/capture-screen

            byte[] bytes = screenShot.EncodeToPNG();
            string filepath = "/storage/emulated/0/Pictures/Screenshots/";

            if (!System.IO.Directory.Exists(filepath))
            {
                System.IO.Directory.CreateDirectory(filepath);
            }
             string filename = filepath + System.DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss") + ".png";

            System.IO.File.WriteAllBytes(filename, bytes);
by (340 points)

感谢您的回复,我这边找到问题了。还是保存路径不对

2.1k Questions

2.5k Answers

3.2k Comments

1.5k Developers

If you have question about this website, please click 'Send Feedback' button at the bottom left side of the homepage.
...