Capturing virtual screen (all monitors)

前端 未结 3 1024
不知归路
不知归路 2021-01-12 18:07

I am trying to get a screenshot of the whole virtual screen. This means, an image of not just the primary screen, but every screen connected to the computer.

Is ther

3条回答
  •  一个人的身影
    2021-01-12 18:48

    Igor is right, passing 0, 0 for the SourceX/Y arguments isn't correct. Iterate the Screen instances in the Screen.AllScreens property to find the bounding rectangle. Beware that CopyFromScreen() has a bug, it cannot capture layered windows (the kind that has TransparencyKey or Opacity set). Check my answer in this thread for a workaround.

    Beware that capturing the entire desktop isn't always practical, you'll get lots of black when the screens are not arranged in a perfect rectangle and an OutOfMemory exception is not uncommon on a 32-bit machine with high resolution displays.

提交回复
热议问题