Lvhang.WindowsCapture
1.1.0
dotnet add package Lvhang.WindowsCapture --version 1.1.0
NuGet\Install-Package Lvhang.WindowsCapture -Version 1.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Lvhang.WindowsCapture" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Lvhang.WindowsCapture" Version="1.1.0" />
<PackageReference Include="Lvhang.WindowsCapture" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Lvhang.WindowsCapture --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Lvhang.WindowsCapture, 1.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Lvhang.WindowsCapture@1.1.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Lvhang.WindowsCapture&version=1.1.0
#tool nuget:?package=Lvhang.WindowsCapture&version=1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
this package is for windows only, so please make sure your porject's TFM is later then net5.0-windows10.0.17763 to make sure install successfully.
<TargetFramework>net5.0-windows10.0.17763</TargetFramework>
**1.1.0 (2021/10/30) release note: **
- fix a bug which the ToBitmap extension method not work on some hardware.
- add IsManual options, by default IsManual is true and you need to call nextFrame to get next frame.
- add nextFrame action in OnFrameArrived to control if send next frame.
- wehn you call PickAndCapture, you can pass an action that will run after user choose a windows/desktop and before receive fist frame.
sample code:
_captureSession = new WindowsCaptureSession(this, new WindowsCaptureSessionOptions()
{
//set minial ms between frames
MinFrameInterval = 50,
IsManual = true,
});
_captureSession.OnFrameArrived += CaptureSession_OnFrameArrived;
_captureSession.PickAndCapture();
//CaptureSession_OnFrameArrived method
private async void CaptureSession_OnFrameArrived(Windows.Graphics.Capture.Direct3D11CaptureFrame frame, Action nextFrame)
{
var bitmap = obj.ToBitmap();
//do something
nextFrame(); //enable to get next frame, if set IsManual to false, you don't have to call this method to get next frame.
}
this project base on below projects:
https://github.com/robmikh/WPFCaptureSample
https://github.com/Microsoft/Windows.UI.Composition-Win32-Samples/tree/master/dotnet/WPF/ScreenCapture
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0-windows10.0.17763 is compatible. net6.0-windows was computed. net7.0-windows was computed. net8.0-windows was computed. net9.0-windows was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net5.0-windows10.0.17763
- SharpDX.Direct3D11 (>= 4.2.0)
- System.Drawing.Common (>= 5.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.1.0 | 737 | 10/30/2021 |