File tree Expand file tree Collapse file tree 14 files changed +94
-26
lines changed
Tests/ScreenCapture.NET.Tests Expand file tree Collapse file tree 14 files changed +94
-26
lines changed Original file line number Diff line number Diff line change 11<Project Sdk =" Microsoft.NET.Sdk" >
22 <PropertyGroup >
3- <TargetFrameworks >net7.0-windows;net6.0-windows</TargetFrameworks >
3+ <TargetFrameworks >net7.0;net6.0</TargetFrameworks >
4+ <RuntimeIdentifier >win-x64</RuntimeIdentifier >
45 <LangVersion >latest</LangVersion >
56 <Nullable >enable</Nullable >
67 <AllowUnsafeBlocks >true</AllowUnsafeBlocks >
2829 <PackageReleaseNotes >
2930 </PackageReleaseNotes >
3031
31- <Version >2.0.0 </Version >
32- <AssemblyVersion >2.0.0 </AssemblyVersion >
33- <FileVersion >2.0.0 </FileVersion >
32+ <Version >2.0.2 </Version >
33+ <AssemblyVersion >2.0.2 </AssemblyVersion >
34+ <FileVersion >2.0.2 </FileVersion >
3435
3536 <OutputPath >..\bin\</OutputPath >
3637 <GenerateDocumentationFile >true</GenerateDocumentationFile >
Original file line number Diff line number Diff line change 11<Project Sdk =" Microsoft.NET.Sdk" >
22 <PropertyGroup >
3- <TargetFrameworks >net7.0-windows;net6.0-windows</TargetFrameworks >
3+ <TargetFrameworks >net7.0;net6.0</TargetFrameworks >
4+ <RuntimeIdentifier >win-x64</RuntimeIdentifier >
45 <LangVersion >latest</LangVersion >
56 <Nullable >enable</Nullable >
67 <AllowUnsafeBlocks >true</AllowUnsafeBlocks >
2829 <PackageReleaseNotes >
2930 </PackageReleaseNotes >
3031
31- <Version >2.0.0 </Version >
32- <AssemblyVersion >2.0.0 </AssemblyVersion >
33- <FileVersion >2.0.0 </FileVersion >
32+ <Version >2.0.2 </Version >
33+ <AssemblyVersion >2.0.2 </AssemblyVersion >
34+ <FileVersion >2.0.2 </FileVersion >
3435
3536 <OutputPath >..\bin\</OutputPath >
3637 <GenerateDocumentationFile >true</GenerateDocumentationFile >
Original file line number Diff line number Diff line change 2929 <PackageReleaseNotes >
3030 </PackageReleaseNotes >
3131
32- <Version >2.0.0 </Version >
33- <AssemblyVersion >2.0.0 </AssemblyVersion >
34- <FileVersion >2.0.0 </FileVersion >
32+ <Version >2.0.2 </Version >
33+ <AssemblyVersion >2.0.2 </AssemblyVersion >
34+ <FileVersion >2.0.2 </FileVersion >
3535
3636 <OutputPath >..\bin\</OutputPath >
3737 <GenerateDocumentationFile >true</GenerateDocumentationFile >
Original file line number Diff line number Diff line change @@ -20,12 +20,21 @@ public sealed class CaptureZone<TColor> : ICaptureZone
2020 /// <inheritdoc />
2121 public Display Display { get ; }
2222
23+ #if NET7_0_OR_GREATER
2324 /// <inheritdoc />
2425 public ColorFormat ColorFormat
2526 {
2627 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
2728 get => TColor . ColorFormat ;
2829 }
30+ #else
31+ /// <inheritdoc />
32+ public ColorFormat ColorFormat
33+ {
34+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
35+ get => default ( TColor ) . Net6ColorFormat ;
36+ }
37+ #endif
2938
3039 /// <inheritdoc />
3140 public int X { get ; internal set ; }
@@ -95,7 +104,7 @@ IImage ICaptureZone.Image
95104 /// <inheritdoc />
96105 public bool IsUpdateRequested { get ; private set ; }
97106
98- #endregion
107+ #endregion
99108
100109 #region Events
101110
Original file line number Diff line number Diff line change @@ -17,6 +17,11 @@ namespace ScreenCapture.NET;
1717 /// <inheritdoc />
1818 public static ColorFormat ColorFormat => ColorFormat . ABGR ;
1919
20+ #if ! NET7_0_OR_GREATER
21+ /// <inheritdoc />
22+ public ColorFormat Net6ColorFormat => ColorFormat ;
23+ #endif
24+
2025 private readonly byte _a ;
2126 private readonly byte _b ;
2227 private readonly byte _g ;
@@ -39,7 +44,7 @@ namespace ScreenCapture.NET;
3944 #endregion
4045
4146 #region Constructors
42-
47+
4348 /// <summary>
4449 /// Initializes a new instance of the <see cref="ColorABGR"/> class.
4550 /// </summary>
Original file line number Diff line number Diff line change @@ -13,10 +13,15 @@ namespace ScreenCapture.NET;
1313public readonly struct ColorARGB : IColor
1414{
1515 #region Properties & Fields
16-
16+
1717 /// <inheritdoc />
1818 public static ColorFormat ColorFormat => ColorFormat . ARGB ;
1919
20+ #if ! NET7_0_OR_GREATER
21+ /// <inheritdoc />
22+ public ColorFormat Net6ColorFormat => ColorFormat ;
23+ #endif
24+
2025 private readonly byte _a ;
2126 private readonly byte _r ;
2227 private readonly byte _g ;
Original file line number Diff line number Diff line change @@ -13,10 +13,15 @@ namespace ScreenCapture.NET;
1313public readonly struct ColorBGR : IColor
1414{
1515 #region Properties & Fields
16-
16+
1717 /// <inheritdoc />
1818 public static ColorFormat ColorFormat => ColorFormat . BGR ;
1919
20+ #if ! NET7_0_OR_GREATER
21+ /// <inheritdoc />
22+ public ColorFormat Net6ColorFormat => ColorFormat ;
23+ #endif
24+
2025 private readonly byte _b ;
2126 private readonly byte _g ;
2227 private readonly byte _r ;
Original file line number Diff line number Diff line change @@ -13,10 +13,15 @@ namespace ScreenCapture.NET;
1313public readonly struct ColorBGRA : IColor
1414{
1515 #region Properties & Fields
16-
16+
1717 /// <inheritdoc />
1818 public static ColorFormat ColorFormat => ColorFormat . BGRA ;
1919
20+ #if ! NET7_0_OR_GREATER
21+ /// <inheritdoc />
22+ public ColorFormat Net6ColorFormat => ColorFormat ;
23+ #endif
24+
2025 private readonly byte _b ;
2126 private readonly byte _g ;
2227 private readonly byte _r ;
@@ -36,7 +41,7 @@ namespace ScreenCapture.NET;
3641 public byte A => _a ;
3742 // ReSharper restore ConvertToAutoPropertyWhenPossible
3843
39- #endregion
44+ #endregion
4045
4146 #region Constructors
4247
Original file line number Diff line number Diff line change @@ -13,10 +13,15 @@ namespace ScreenCapture.NET;
1313public readonly struct ColorRGB : IColor
1414{
1515 #region Properties & Fields
16-
16+
1717 /// <inheritdoc />
1818 public static ColorFormat ColorFormat => ColorFormat . RGB ;
1919
20+ #if ! NET7_0_OR_GREATER
21+ /// <inheritdoc />
22+ public ColorFormat Net6ColorFormat => ColorFormat ;
23+ #endif
24+
2025 private readonly byte _r ;
2126 private readonly byte _g ;
2227 private readonly byte _b ;
Original file line number Diff line number Diff line change @@ -17,6 +17,11 @@ namespace ScreenCapture.NET;
1717 /// <inheritdoc />
1818 public static ColorFormat ColorFormat => ColorFormat . RGBA ;
1919
20+ #if ! NET7_0_OR_GREATER
21+ /// <inheritdoc />
22+ public ColorFormat Net6ColorFormat => ColorFormat ;
23+ #endif
24+
2025 private readonly byte _r ;
2126 private readonly byte _g ;
2227 private readonly byte _b ;
You can’t perform that action at this time.
0 commit comments