diff --git a/src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj b/src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj index 877b910b466..0dded31a24a 100644 --- a/src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj +++ b/src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj @@ -43,7 +43,7 @@ - + diff --git a/src/BootstrapBlazor.Server/Components/Samples/ImageCroppers.razor b/src/BootstrapBlazor.Server/Components/Samples/ImageCroppers.razor index 16d2763af2d..e364264cca1 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/ImageCroppers.razor +++ b/src/BootstrapBlazor.Server/Components/Samples/ImageCroppers.razor @@ -7,34 +7,50 @@ - +
- + + + + + + + +
+
+
+
+
+
+ @if (!string.IsNullOrEmpty(_base64String)) { - - }
- - + +
- + +
+
+
+
+
+
+ @if (!string.IsNullOrEmpty(_base64String2)) { - + }
diff --git a/src/BootstrapBlazor.Server/Components/Samples/ImageCroppers.razor.cs b/src/BootstrapBlazor.Server/Components/Samples/ImageCroppers.razor.cs index 37b92bcc899..754826fbc9d 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/ImageCroppers.razor.cs +++ b/src/BootstrapBlazor.Server/Components/Samples/ImageCroppers.razor.cs @@ -22,7 +22,9 @@ public partial class ImageCroppers private string? _base64String2; - private readonly ImageCropperOption _roundOptions = new() { IsRound = true, Radius = "50%", AspectRatio = 3/4f }; + private readonly ImageCropperOption _roundOptions1 = new() { AspectRatio = 16 / 9f, Preview = ".bb-cropper-preview1" }; + + private readonly ImageCropperOption _roundOptions2 = new() { IsRound = true, Preview = ".bb-cropper-preview-round" }; /// /// @@ -56,11 +58,7 @@ private async Task RoundCrop() private Task Rotate() => _cropper.Rotate(90); - /// - /// GetAttributes - /// - /// - protected AttributeItem[] GetAttributes() => + private AttributeItem[] GetAttributes() => [ new() { diff --git a/src/BootstrapBlazor.Server/Locales/en-US.json b/src/BootstrapBlazor.Server/Locales/en-US.json index 7922de981fd..c0767e3afab 100644 --- a/src/BootstrapBlazor.Server/Locales/en-US.json +++ b/src/BootstrapBlazor.Server/Locales/en-US.json @@ -6679,7 +6679,9 @@ "BootstrapBlazor.Server.Components.Samples.ImageCroppers": { "Title": "Image cropper", "ImageCropperNormalText": "Basic usage", - "ImageCropperNormalIntro": "Url parameter setting image", + "ImageCropperNormalIntro": "The URL of the image can be set by setting the Url parameter. The cropping ratio can be set by setting ImageCropperOption.AspectRatio=16/9f. 1 is a square.", + "ImageCropperRoundText": "Round", + "ImageCropperRoundIntro": "Set the cropping mode to circular by setting the IsRound parameter", "ImageCropperResetText": "Reset", "ImageCropperReplaceText": "Replace", "ImageCropperRotateText": "Rotate", diff --git a/src/BootstrapBlazor.Server/Locales/zh-CN.json b/src/BootstrapBlazor.Server/Locales/zh-CN.json index 70b84d8a675..fbc116486ab 100644 --- a/src/BootstrapBlazor.Server/Locales/zh-CN.json +++ b/src/BootstrapBlazor.Server/Locales/zh-CN.json @@ -6679,7 +6679,9 @@ "BootstrapBlazor.Server.Components.Samples.ImageCroppers": { "Title": "ImageCropper 图像裁剪", "ImageCropperNormalText": "基础用法", - "ImageCropperNormalIntro": "Url 参数设置图片", + "ImageCropperNormalIntro": "通过设置 Url 参数设置图片地址,可通过设置 ImageCropperOption.AspectRatio=16/9f 设置裁剪框比例,1 时为正方形", + "ImageCropperRoundText": "圆角", + "ImageCropperRoundIntro": "通过设置 IsRound 参数设置裁剪方式为圆形", "ImageCropperResetText": "复位", "ImageCropperReplaceText": "替换", "ImageCropperRotateText": "旋转",