diff --git a/QRCoder/SvgQRCode.cs b/QRCoder/SvgQRCode.cs index e03ce5dc..25ba8c8c 100644 --- a/QRCoder/SvgQRCode.cs +++ b/QRCoder/SvgQRCode.cs @@ -1,4 +1,4 @@ -#if NETFRAMEWORK || NETSTANDARD2_0 || NET5_0 || NET6_0_WINDOWS +#if NETFRAMEWORK || NETSTANDARD2_0 || NET5_0_OR_GREATER using QRCoder.Extensions; using System; using System.Collections; @@ -11,9 +11,6 @@ namespace QRCoder { -#if NET6_0_WINDOWS - [System.Runtime.Versioning.SupportedOSPlatform("windows")] -#endif public class SvgQRCode : AbstractQRCode, IDisposable { /// @@ -270,13 +267,16 @@ public class SvgLogo private object _logoRaw; private bool _isEmbedded; - +#if NETFRAMEWORK || NETSTANDARD2_0 || NET5_0 || NET6_0_WINDOWS /// /// Create a logo object to be used in SvgQRCode renderer /// /// Logo to be rendered as Bitmap/rasterized graphic /// Degree of percentage coverage of the QR code by the logo /// If true, the background behind the logo will be cleaned +#if NET6_0_WINDOWS + [System.Runtime.Versioning.SupportedOSPlatform("windows")] +#endif public SvgLogo(Bitmap iconRasterized, int iconSizePercent = 15, bool fillLogoBackground = true) { _iconSizePercent = iconSizePercent; @@ -293,6 +293,7 @@ public SvgLogo(Bitmap iconRasterized, int iconSizePercent = 15, bool fillLogoBac _logoRaw = iconRasterized; _isEmbedded = false; } +#endif /// /// Create a logo object to be used in SvgQRCode renderer @@ -379,9 +380,6 @@ public enum MediaType : int } } -#if NET6_0_WINDOWS - [System.Runtime.Versioning.SupportedOSPlatform("windows")] -#endif public static class SvgQRCodeHelper { public static string GetQRCode(string plainText, int pixelsPerModule, string darkColorHex, string lightColorHex, ECCLevel eccLevel, bool forceUtf8 = false, bool utf8BOM = false, EciMode eciMode = EciMode.Default, int requestedVersion = -1, bool drawQuietZones = true, SizingMode sizingMode = SizingMode.WidthHeightAttribute, SvgLogo logo = null) diff --git a/QRCoderTests/SvgQRCodeRendererTests.cs b/QRCoderTests/SvgQRCodeRendererTests.cs index b0620594..f2d11a35 100644 --- a/QRCoderTests/SvgQRCodeRendererTests.cs +++ b/QRCoderTests/SvgQRCodeRendererTests.cs @@ -1,4 +1,4 @@ -#if !NETCOREAPP1_1 && !NET6_0 +#if !NETCOREAPP1_1 using System; using Xunit; using QRCoder; @@ -103,6 +103,7 @@ public void can_render_svg_qrcode_without_quietzones_hex() result.ShouldBe("4ab0417cc6127e347ca1b2322c49ed7d"); } +#if NETFRAMEWORK || NETSTANDARD2_0 || NET5_0 || NET6_0_WINDOWS [Fact] [Category("QRRenderer/SvgQRCode")] public void can_render_svg_qrcode_with_png_logo() @@ -121,6 +122,7 @@ public void can_render_svg_qrcode_with_png_logo() var result = HelperFunctions.StringToHash(svg); result.ShouldBe("78e02e8ba415f15817d5ed88c4afca31"); } +#endif [Fact] [Category("QRRenderer/SvgQRCode")]