以下方法取自WinForms应用程序。它只是捕获屏幕,但我需要修改它才能在WPF应用程序中工作。当我使用它时,它返回一个黑色图像。尺寸正确。我没有任何打开的DirectX或视频,即使在我的桌面上也无法运行。publicstaticBitmapCaptureScreen(){//SetupabitmapofthecorrectsizeBitmapCapturedImage=newBitmap((int)SystemParameters.VirtualScreenWidth,(int)SystemParameters.VirtualScreenHeight,System.Drawing.I