You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -36,8 +39,14 @@ public sealed class DX11ScreenCapture : IScreenCapture
36
39
37
40
privateint_indexCounter=0;
38
41
42
+
/// <inheritdoc />
39
43
publicDisplayDisplay{get;}
40
44
45
+
/// <summary>
46
+
/// Gets or sets the timeout in ms used for screen-capturing. (default 1000ms)
47
+
/// This is used in <see cref="CaptureScreen"/> https://docs.microsoft.com/en-us/windows/win32/api/dxgi1_2/nf-dxgi1_2-idxgioutputduplication-acquirenextframe
48
+
/// </summary>
49
+
// ReSharper disable once MemberCanBePrivate.Global
41
50
publicintTimeout{get;set;}=1000;
42
51
43
52
privatereadonlyIDXGIFactory1_factory;
@@ -54,12 +63,18 @@ public sealed class DX11ScreenCapture : IScreenCapture
/// Attemts to capture the current frame showed on the <see cref="Display"/>.
22
+
/// </summary>
23
+
/// <returns><c>true</c> if the current frame was captures successfully; otherwise, <c>false</c>.</returns>
9
24
boolCaptureScreen();
25
+
26
+
/// <summary>
27
+
/// Creates a new <see cref="CaptureScreen"/> for this <see cref="IScreenCapture"/>.
28
+
/// </summary>
29
+
/// <param name="x">The x-location of the region to capture (must be >= 0 and < screen-width).</param>
30
+
/// <param name="y">The x-location of the region to capture (must be >= 0 and < screen-height).</param>
31
+
/// <param name="width">The width of the region to capture (must be >= 0 and this + x must be <= screen-width).</param>
32
+
/// <param name="height">The height of the region to capture (must be >= 0 and this + y must be <= screen-height).</param>
33
+
/// <param name="downscaleLevel">The level of downscaling applied to the image of this region before copying to local memory. The calculation is (width and height)/2^downscaleLevel.</param>
34
+
/// <returns>The new <see cref="CaptureScreen"/>.</returns>
Copy file name to clipboardExpand all lines: ScreenCapture/Model/BlackBarDetection.cs
+24-2Lines changed: 24 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,26 +1,45 @@
1
-
usingSystem;
1
+
// ReSharper disable MemberCanBePrivate.Global
2
+
usingSystem;
2
3
3
4
namespaceScreenCapture
4
5
{
6
+
/// <summary>
7
+
/// Represents the configuration for the detection and removal of black bars around the screen image.
8
+
/// </summary>
5
9
publicsealedclassBlackBarDetection
6
10
{
7
11
#region Properties & Fields
8
12
9
13
privatereadonlyCaptureZone_captureZone;
10
14
11
15
privateint?_top;
16
+
/// <summary>
17
+
/// Gets the size of the detected black bar at the top of the image.
18
+
/// </summary>
12
19
publicintTop=>_top??=CalculateTop();
13
20
14
21
privateint?_bottom;
22
+
/// <summary>
23
+
/// Gets the size of the detected black bar at the bottom of the image.
24
+
/// </summary>
15
25
publicintBottom=>_bottom??=CalculateBottom();
16
26
17
27
privateint?_left;
28
+
/// <summary>
29
+
/// Gets the size of the detected black bar at the left of the image.
30
+
/// </summary>
18
31
publicintLeft=>_left??=CalculateLeft();
19
32
20
33
privateint?_right;
34
+
/// <summary>
35
+
/// Gets the size of the detected black bar at the right of the image.
36
+
/// </summary>
21
37
publicintRight=>_right??=CalculateRight();
22
38
23
39
privateint_theshold=0;
40
+
/// <summary>
41
+
/// Gets or sets the threshold of "blackness" used to detect black bars. (e. g. Threshold 5 will consider a pixel of color [5,5,5] as black.) (default 0)
42
+
/// </summary>
24
43
publicintThreshold
25
44
{
26
45
get=>_theshold;
@@ -35,7 +54,7 @@ public int Threshold
35
54
36
55
#region Constructors
37
56
38
-
publicBlackBarDetection(CaptureZonecaptureZone)
57
+
internalBlackBarDetection(CaptureZonecaptureZone)
39
58
{
40
59
this._captureZone=captureZone;
41
60
}
@@ -44,6 +63,9 @@ public BlackBarDetection(CaptureZone captureZone)
44
63
45
64
#region Methods
46
65
66
+
/// <summary>
67
+
/// Invalidates the cached values and recalculates <see cref="Top"/>, <see cref="Bottom"/>, <see cref="Left"/> and <see cref="Right"/>.
0 commit comments