Skip to content

Commit 63be0d9

Browse files
Merge branch 'hotfix/hotfix-v27.1.48' into BLAZ-910110-MultiH1C
2 parents 06b785b + 7e310dd commit 63be0d9

15 files changed

+615
-4
lines changed

blazor-toc.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3101,6 +3101,13 @@
31013101
<li> <a href="/blazor/image-editor/redact">Redact</a></li>
31023102
<li> <a href="/blazor/image-editor/localization">Localization</a></li>
31033103
<li> <a href="/blazor/image-editor/accessibility">Accessibility</a></li>
3104+
<li>How To
3105+
<ul>
3106+
<li> <a href="/blazor/input-mask/how-to/clear-image">Clear an Image</a></li>
3107+
<li> <a href="/blazor/input-mask/how-to/render-dialog">Render Dialog in Image Editor</a></li>
3108+
<li> <a href="/blazor/input-mask/how-to/reset"></a>Reset an image</li>
3109+
</ul>
3110+
</li>
31043111
<li>
31053112
<a href="/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html"> API Reference</a>
31063113
</li>

blazor/image-editor/annotation.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,3 +656,33 @@ In the following example, you can use the [`DrawImageAsync`](https://help.syncfu
656656
```
657657

658658
![Blazor Image Editor with Add Image in an image](./images/blazor-image-editor-add-image.png)
659+
660+
### Customize Default Stroke Color for Shapes
661+
662+
We provide default settings for stroke color, stroke width, fill color, and other customizations. If users wish to modify only the default options while preserving their previously selected customizations, they can do so by utilizing the [`ShapeChanging`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ShapeChangeEventArgs.html) event. Within this event, users can update the values in the [`CurrentShapeSettings`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ShapeChangeEventArgs.html#Syncfusion_Blazor_ImageEditor_ShapeChangeEventArgs_CurrentShapeSettings) object to apply their own preferences instead of the defaults. This approach allows conditional updates to the [`CurrentShapeSettings`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.ShapeChangeEventArgs.html#Syncfusion_Blazor_ImageEditor_ShapeChangeEventArgs_CurrentShapeSettings), ensuring that only the desired defaults are changed while maintaining the other settings.
663+
664+
```cshtml
665+
@using Syncfusion.Blazor.ImageEditor
666+
667+
<SfImageEditor @ref="ImageEditor" Toolbar="customToolbarItem" Height="400">
668+
<ImageEditorEvents Created="CreatedAsync" ShapeChanging="ShapeChangingAsync"></ImageEditorEvents>
669+
</SfImageEditor>
670+
671+
@code {
672+
SfImageEditor ImageEditor;
673+
private List<ImageEditorToolbarItemModel> customToolbarItem = new List<ImageEditorToolbarItemModel>() { };
674+
675+
private async void CreatedAsync()
676+
{
677+
await ImageEditor.OpenAsync("nature.png");
678+
}
679+
680+
private async void ShapeChangingAsync(ShapeChangingEventArgs args)
681+
{
682+
if (args.action === "insert" && args.currentShapeSettings?.type === "FreehandDraw") {
683+
args.currentShapeSettings.strokeColor = "red";
684+
}
685+
}
686+
}
687+
```
688+
![Blazor Image Editor with Default Color](./images/blazor-image-editor-default-stroke-color.jpeg)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
layout: post
3+
title: Clear an Image with Blazor Image Editor Component | Syncfusion
4+
description: Learn here all about Clear an Image in Blazor Image Editor component in Blazor Server App and Blazor WebAssembly App.
5+
platform: Blazor
6+
control: Image Editor
7+
documentation: ug
8+
---
9+
10+
# Clear an Image in the Blazor Image Editor component
11+
12+
The [`ClearImageAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_ClearImageAsync) method in the image editor control is indeed useful for scenarios where you need to ensure that the image editor is emptied before reopening it, especially if the editor is used within a dialog. By using [`ClearImageAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_ClearImageAsync) before closing the dialog, you can ensure that the editor does not retain the previously loaded image when the dialog is reopened. This allows users to start fresh with a new image selection.
13+
14+
```cshtml
15+
@using Syncfusion.Blazor.ImageEditor
16+
@using Syncfusion.Blazor.Buttons
17+
18+
<div style="padding-bottom: 15px">
19+
<SfButton OnClick="ClearImageAsync">Clear Image</SfButton>
20+
</div>
21+
<SfImageEditor @ref="ImageEditor" Height="400">
22+
<ImageEditorEvents Created="OpenAsync"></ImageEditorEvents>
23+
</SfImageEditor>
24+
25+
@code {
26+
SfImageEditor ImageEditor;
27+
28+
private async void OpenAsync()
29+
{
30+
await ImageEditor.OpenAsync("nature.png");
31+
}
32+
33+
private async void ClearImageAsync()
34+
{
35+
await ImageEditor.ClearImageAsync();
36+
}
37+
}
38+
```
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
layout: post
3+
title: Clear an Image with Blazor Image Editor Component | Syncfusion
4+
description: Learn here all about Clear an Image in Blazor Image Editor component in Blazor Server App and Blazor WebAssembly App.
5+
platform: Blazor
6+
control: Image Editor
7+
documentation: ug
8+
---
9+
10+
# Render Image Editor in Dialog Component
11+
12+
Rendering the Image Editor in a dialog involves displaying the image editor component within a modal dialog window, allowing users to edit images in a pop-up interface. This can be useful for maintaining a clean layout and providing a focused editing experience without navigating away from the current page.
13+
14+
```cshtml
15+
@using Syncfusion.Blazor.ImageEditor
16+
@using Syncfusion.Blazor.Buttons
17+
@using Syncfusion.Blazor.Popups
18+
@using Syncfusion.Blazor.Inputs
19+
20+
<div style="padding-bottom: 15px">
21+
@if (this.ShowButton)
22+
{
23+
<SfButton OnClick="OpenDialogAsync">Open Image</SfButton>
24+
}
25+
</div>
26+
<SfDialog Height="75%" Width="435px" Target="#target" ShowCloseIcon="true" @bind-Visible="Visibility">
27+
<DialogTemplates>
28+
<Content>
29+
<div class="dialogContent">
30+
31+
<SfImageEditor @ref="ImageEditor" Height="400px">
32+
<ImageEditorEvents Created="OpenAsync"></ImageEditorEvents>
33+
</SfImageEditor>
34+
</div>
35+
</Content>
36+
</DialogTemplates>
37+
<DialogEvents OnOpen="@BeforeDialogOpen" Closed="@DialogClosed"></DialogEvents>
38+
</SfDialog>
39+
40+
@code {
41+
private bool Visibility { get; set; } = false;
42+
private bool ShowButton { get; set; } = true;
43+
SfImageEditor ImageEditor;
44+
45+
private async void OpenDialogAsync()
46+
{
47+
this.Visibility = true;
48+
}
49+
50+
private async void OpenAsync()
51+
{
52+
await ImageEditor.OpenAsync("nature.png");
53+
}
54+
55+
private void BeforeDialogOpen(BeforeOpenEventArgs args)
56+
{
57+
this.ShowButton = false;
58+
}
59+
60+
private void DialogClosed(CloseEventArgs args)
61+
{
62+
this.ShowButton = true;
63+
}
64+
}
65+
```

blazor/image-editor/how-to/reset.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
layout: post
3+
title: Reset an Image with Blazor Image Editor Component | Syncfusion
4+
description: Learn here all about Reset an image in Blazor Image Editor component in Blazor Server App and Blazor WebAssembly App.
5+
platform: Blazor
6+
control: Image Editor
7+
documentation: ug
8+
---
9+
10+
# Reset an image in the Blazor Image Editor component
11+
12+
The [`ResetAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_ResetAsync) method in the Image Editor control provides the capability to undo all the changes made to an image and revert it back to its original state. This method is particularly useful when multiple adjustments, annotations, or transformations have been applied to an image and you want to start over with the original, unmodified version of the image.
13+
14+
By invoking the [`ResetAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.ImageEditor.SfImageEditor.html#Syncfusion_Blazor_ImageEditor_SfImageEditor_ResetAsync) method, any modifications or edits made to the image will be undone, and the image will be restored to its initial state. This allows you to easily discard any changes and begin again with the fresh, unaltered image.
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)