fix wgc not work in early win10 version

This commit is contained in:
huiyadanli 2023-10-10 22:33:58 +08:00
parent 44fe024985
commit c2e46dc32b

View File

@ -2,6 +2,7 @@
using SharpDX.Direct3D11;
using System.Diagnostics;
using Vanara.PInvoke;
using Windows.Foundation.Metadata;
using Windows.Graphics.Capture;
using Windows.Graphics.DirectX;
@ -44,7 +45,10 @@ public class GraphicsCapture : IGameCapture
_captureItem.Size);
_captureSession = _captureFramePool.CreateCaptureSession(_captureItem);
_captureSession.IsCursorCaptureEnabled = false;
_captureSession.IsBorderRequired = false;
if (ApiInformation.IsWriteablePropertyPresent("Windows.Graphics.Capture.GraphicsCaptureSession", "IsBorderRequired"))
{
_captureSession.IsBorderRequired = false;
}
_captureSession.StartCapture();
IsCapturing = true;
}