diff --git a/ScreenCapture.NET/DirectX/DX11ScreenCapture.cs b/ScreenCapture.NET/DirectX/DX11ScreenCapture.cs
index dd54a7e..d0434b8 100644
--- a/ScreenCapture.NET/DirectX/DX11ScreenCapture.cs
+++ b/ScreenCapture.NET/DirectX/DX11ScreenCapture.cs
@@ -38,6 +38,7 @@ namespace ScreenCapture.NET
private readonly object _captureLock = new();
+ private readonly bool _useNewDuplicationAdapter;
private int _indexCounter = 0;
///
@@ -74,12 +75,17 @@ namespace ScreenCapture.NET
///
/// Initializes a new instance of the class.
///
+ ///
+ /// Note that setting useNewDuplicationAdapter to true requires to call DPIAwareness.Initalize(); and prevents the capture from running in a WPF-thread.
+ ///
/// The used to create underlying objects.
/// The to duplicate.
- public DX11ScreenCapture(IDXGIFactory1 factory, Display display)
+ /// Indicates if the DuplicateOutput1 interface should be used instead of the older DuplicateOutput. Currently there's no real use in setting this to true.
+ public DX11ScreenCapture(IDXGIFactory1 factory, Display display, bool useNewDuplicationAdapter = false)
{
this._factory = factory;
this.Display = display;
+ this._useNewDuplicationAdapter = useNewDuplicationAdapter;
Restart();
}
@@ -325,8 +331,11 @@ namespace ScreenCapture.NET
foreach (CaptureZone captureZone in captureZones)
InitializeCaptureZone(captureZone);
}
-
- _duplicatedOutput = output.DuplicateOutput1(_device, Format.B8G8R8A8_UNorm); // DarthAffe 27.02.2021: This prepares for the use of 10bit color depth
+
+ if (_useNewDuplicationAdapter)
+ _duplicatedOutput = output.DuplicateOutput1(_device, Format.B8G8R8A8_UNorm); // DarthAffe 27.02.2021: This prepares for the use of 10bit color depth
+ else
+ _duplicatedOutput = output.DuplicateOutput(_device);
}
catch { Dispose(false); }
}