ScreenCapture

Yo. Sebls screencapture experiments made me curious and I stumbled upon:

There is an example on how to use it in WPF applications:

The project uses (among others) the following package:
NuGet Gallery | Microsoft.Windows.SDK.Contracts 10.0.19041.1-preview.vb-release

Wanted to take a peek in Gamma. While installing / referencing works nothing shows up in the nodebrowser. Any ideas?

The Microsoft sample:
ScreenCapture.7z (264.7 KB)

2 Likes

here’s the experiment which uses the nuget
screencapture.vl (12.8 KB)

and this is the windows standard method (which is much slower):
Screeeeenshot.vl (16.2 KB)
i reach ~30fps with both implementations

is this thing only for UWP Apps?

maybe have a look a t this repo:
https://github.com/microsoft/Windows.UI.Composition-Win32-Samples/tree/master/dotnet/WPF/ScreenCapture´

indeed this capturing works really nice and fast. for testing, you can run the sample i linked and have a look. much faster and nicer thatn the 2 approaches i patched quickly as proof of concepts.
it even works so well and the framerate is so high, that i can imagine this could replace fraps et al at some point.

having a closer look:
i don’t see a way to reference the Windows.Graphics.Capture assembly.
This does work fine in c# (.net framework) when referencing Microsoft.Windows.SDK.Contracts, but not in vl.
investigating that nuget, is seems there isn’t dlls inside, but for example files like this:
C:\Users\YOURUSERNAME\.nuget\packages\microsoft.windows.sdk.contracts\10.0.18362.2002-preview\ref\netstandard2.0\Windows.Foundation.UniversalApiContract.winmd and vl doesn’t like that.


so, i think we need the devvvvs shining some light on this.

workaround would be to wrap that stuff in c#, of course. that ScreenCapture Sample would be a good start with everything needed inside.

1 Like

The nuget page states:

The Windows 10 WinRT API Pack enables you to add the latest Windows Runtime APIs support to your .NET Framework 4.6+ and .NET Core 3.0+ libraries and apps.

That’s exactly what I linked in my post ;)

You can find a compiled version in the 7zip I attached above.

1 Like

oh, sorry… i was just following your first link and somehow missed the second one.

i found a slightly different nuget (10.0.18362.2005 seems to be the actual stable one) and also tried to reference it but then the .winmd thing came up.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.