Search code examples
windows-runtimescreencapture

Which version does support Windows.Graphics.Capture?


I saw the graph capture item in microsoft website is supported on 1803, but I can't run on this version. If I call the following code, then crashes

auto interop_factory = winrt::get_activation_factory<winrt::Windows::Graphics::Capture::GraphicsCaptureItem, IGraphicsCaptureItemInterop>();

Solution

  • GraphicsCaptureItem exists indeed in Windows 10, version 1803. However, IGraphicsCaptureItemInterop does not, you need Windows 10, version 1903 to consume the API this way.

    In Windows 10, version 1803 you are supposed to use GraphicsCapturePicker.PickSingleItemAsync instead.