I have been searching for an API to capture screen images in a WinUI 3 app (without the user selecting from a picker, as from GraphicsCaptureItem). My goal is to capture screen images under programmatic control and display them on a Canvas element. Most of what I've found so far are APIs that work only on Windows forms.
I can think of some possible ways to do this by using interop to Win32 functionality, but hopefully there is a WinUI 3 compatible library that can be used directly (such as System.Windows.Forms.Screen, which is used on Windows forms).
Thanks in advance for any advice that can be offered.
2/6 - checked out the link from Simon Mourier and tried out a ScreenCapture app that uses CreateForMonitor: https://github.com/microsoft/Windows.UI.Composition-Win32-Samples/tree/master/dotnet/WPF/ScreenCapture. At this point, there would be quite some work to port this app to WinUI 3 as it is quite complex and uses interop for Direct3D functionality. However, it is progress and I appreciate the response.