Closed lostmsu closed 2 years ago
Take a look at this file:
That repo has a version of the WPF capture sample that's been updated for .NET 5/6.
@robmikh that did not immediately work due to my need to understand CSWinRT, so I ended up not using your code. But simply following this table I got a working sample, that does not need to use CSWinRT magic explicitly, and does not require unsafe
:
public static GraphicsCaptureItem CreateItemForMonitor(IntPtr hmon)
{
var factory = GraphicsCaptureItem.As<IGraphicsCaptureItemInterop>();
var itemPointer = factory.CreateForMonitor(hmon, GraphicsCaptureItemGuid);
var item = GraphicsCaptureItem.FromAbi(itemPointer);
Marshal.Release(itemPointer);
return item;
}
@robmikh no plans to update the samples in this repo?
It's on the list, currently getting the C++ samples updated.
Is there a replacement for .NET 5+?
Example: