ScreenCapturer 2.0.0
See the version list below for details.
dotnet add package ScreenCapturer --version 2.0.0
NuGet\Install-Package ScreenCapturer -Version 2.0.0
<PackageReference Include="ScreenCapturer" Version="2.0.0" />
paket add ScreenCapturer --version 2.0.0
#r "nuget: ScreenCapturer, 2.0.0"
// Install ScreenCapturer as a Cake Addin #addin nuget:?package=ScreenCapturer&version=2.0.0 // Install ScreenCapturer as a Cake Tool #tool nuget:?package=ScreenCapturer&version=2.0.0
Usage
All methods, events and properties can be accessed using static ScreenCapturer
class.
Methods
StartCapture
— starts capture and callback threads.
StopCapturing
— asynchronously stops capture and callback threads.
Events
OnScreenUpdated
— dispatched when screen snapshot was made, additional info in notes.
OnCaptureStop
— dispatched when capture is stopped manually or because of exception.
Flags and options
SkipFirstFrame
— if flag is set to true
(default) then first captured screen snapshot gets skipped and no callbacks called (for some unknown reason it is a black screen, apparently SharpDX related issue).
SkipFrames
— if flag is set to true
(default) and snapshot queue size gets over than 2 bitmaps then oldest bitmaps get removed.
PreserveBitmap
— if flag is set to false
(default) then after callbacks were executed bitmap gets disposed automatically.
IsActive
— read-only property that indicates that capture is active (it can be starting, in progress or going to be stopped).
IsNotActive
— read-only property that indicated that capture is not active (opposite to IsActive
).
Notes
You can set callback by passing action as argument to StartCapture
or set it as standard event callback using OnScreenUpdated
. StopCapturing
will stop capture as fast as possible, however method will return immediately to minimize deadlock possibility.
Use OnCaptureStop
event if you need to perform actions after capture was really stopped. If capture process gets interrupted by exception (SharpDX exception in capture thread or exception in any of capture callbacks in callback thread) and OnCaptureStop
event has assigned callback — it will be called with exception as argument (might be useful if resolution gets changed and etc.), otherwise regular exception will be thrown.
Possible issues
If capture gets often interrupted by SharpDX exceptions small memory leaks may occur, though it's should be unnoticable in most cases and can be ignored.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETFramework 4.5
- SharpDX (>= 4.2.0)
- SharpDX.Direct3D11 (>= 4.2.0)
- SharpDX.DXGI (>= 4.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.