C# Screen Capture on Multiple Screens Winform Appl

2019-07-09 09:26发布

问题:

I know this is maybe old subject. But I have to know about it in detailed explanation.

Thanks in advance.

I have below code snippet from here

 public static Image Snip() {
        var rc = Screen.PrimaryScreen.Bounds;
        using (Bitmap bmp = new Bitmap(rc.Width, rc.Height, System.Drawing.Imaging.PixelFormat.Format32bppPArgb)) {
            using (Graphics gr = Graphics.FromImage(bmp))
                gr.CopyFromScreen(0, 0, 0, 0, bmp.Size);
            using (var snipper = new SnippingTool(bmp)) {
                if (snipper.ShowDialog() == DialogResult.OK) {
                    return snipper.Image;
                }
            }
            return null;
        }
    }

Now, what about on multiple screens? This code only shows based on primary screen. But I want to play capture on multiple screen bounds!