自应用程序C#以来将照片拍到PC?

|                                                                                                                       
已邀请:
您可以使用以下方法获取单个窗口或整个屏幕的屏幕截图:
    public void WindowsScreenshot()
    {
        // Full
        Rectangle bounds = Screen.GetBounds(Point.Empty);
        using (Bitmap bitmap = new Bitmap(bounds.Width, bounds.Height))
        {
            using (Graphics g = Graphics.FromImage(bitmap))
            {
                g.CopyFromScreen(Point.Empty, Point.Empty, bounds.Size);
            }
            bitmap.Save(\"test_full.jpg\", ImageFormat.Jpeg);
        }

        // Window
        Rectangle bounds = this.Bounds;
        using (Bitmap bitmap = new Bitmap(bounds.Width, bounds.Height))
        {
            using (Graphics g = Graphics.FromImage(bitmap))
            {
                g.CopyFromScreen(new Point(bounds.Left, bounds.Top), Point.Empty, bounds.Size);
            }
            bitmap.Save(\"test_window.jpg\", ImageFormat.Jpeg);
        }
    }
    

要回复问题请先登录注册