Loading...
Loading...
Implement comprehensive image editing capabilities in Blazor applications using the Syncfusion Image Editor component. Use this skill when implementing image editing, annotations, transformations, cropping, filtering, zooming, and panning features. Supports annotations (text, shapes, freehand), transformations (crop, rotate, flip, resize), effects (filters, fine-tuning), toolbar customization, and keyboard shortcuts.
npx skill4agent add syncfusion/blazor-ui-components-skills syncfusion-blazor-image-editor@using Syncfusion.Blazor.ImageEditor
<SfImageEditor @ref="ImageEditor" Height="500px" Width="100%">
<ImageEditorEvents Created="OnCreated"></ImageEditorEvents>
</SfImageEditor>
@code {
SfImageEditor ImageEditor;
private async void OnCreated()
{
// Load an image when component is ready
await ImageEditor.OpenAsync("path/to/image.png");
}
}Syncfusion.Blazor.ImageEditorSyncfusion.Blazor.Themes_Imports.razor@using Syncfusion.Blazor.ImageEditorProgram.csbuilder.Services.AddSyncfusionBlazor();index.htmlApp.razorCreated| Feature | Purpose | Reference |
|---|---|---|
| Image Loading | Open JPEG, PNG, JPG, WEBP, BMP files | core-operations.md |
| Text Annotations | Add labels, captions, watermarks with underline/strikethrough | annotations.md |
| Shape Annotations | Draw rectangles, ellipses, arrows, paths with z-order control | annotations.md |
| Freehand Drawing | Sketch and draw directly on images | annotations.md |
| Redaction | Hide sensitive info with blur/pixelate for privacy compliance | redaction.md |
| Frames | Apply decorative borders (Mat, Bevel, Line, Inset, Hook) | frames.md |
| Crop & Transform | Crop with multiple selection types, rotate, flip, straighten | image-transformations.md |
| Filters & Effects | Apply fine-tuning and predefined filters | adjustments-filters-effects.md |
| Zoom & Pan | Multiple zoom methods and image panning | user-interactions.md |
| Export | Save as PNG, JPEG, SVG, WEBP with quality control | core-operations.md |
| Undo/Redo | Full history of operations | core-operations.md |
| Events | 30+ lifecycle, transformation, shape, and interaction events | events-reference.md |
| Toolbar | Built-in or custom toolbar with events | toolbar-customization.md |
| Accessibility | Keyboard navigation, screen readers, RTL, localization | accessibility-localization.md |
<SfImageEditor @ref="ImageEditor" Height="500px">
<ImageEditorEvents Created="OnCreated"></ImageEditorEvents>
</SfImageEditor>
@code {
SfImageEditor ImageEditor;
private async void OnCreated()
{
await ImageEditor.OpenAsync("https://example.com/image.png");
}
private async Task AddTextAnnotation()
{
ImageDimension dim = await ImageEditor.GetImageDimensionAsync();
await ImageEditor.DrawTextAsync(dim.X.Value, dim.Y.Value, "Important", "Arial", 24);
}
}<SfImageEditor @ref="ImageEditor" Toolbar="@CustomToolbar" Height="500px">
<ImageEditorEvents Created="OnCreated" ToolbarItemClicked="OnToolbarClick"></ImageEditorEvents>
</SfImageEditor>
@code {
private List<ImageEditorToolbarItemModel> CustomToolbar = new()
{
new ImageEditorToolbarItemModel { Name = "Open" },
new ImageEditorToolbarItemModel { Name = "Crop" },
new ImageEditorToolbarItemModel { Name = "Annotation" },
new ImageEditorToolbarItemModel { Name = "Save" }
};
}private async Task ExportImage()
{
// Export as PNG (lossless, default)
await ImageEditor.ExportAsync("edited-image.png");
// Export as JPEG with quality control (0.0 to 1.0)
await ImageEditor.ExportAsync("photo.jpg", ImageEditorFileType.JPEG, 0.85);
// Export as WEBP (modern format)
await ImageEditor.ExportAsync("image.webp", ImageEditorFileType.WEBP);
// Export as SVG (vector format)
await ImageEditor.ExportAsync("graphic.svg", ImageEditorFileType.SVG);
// Or press Ctrl+S to open export dialog with format selection
}<SfImageEditor @ref="ImageEditor" Height="500px">
<ImageEditorEvents Created="OnCreated"></ImageEditorEvents>
</SfImageEditor>
@code {
SfImageEditor ImageEditor;
private async Task RedactSensitiveInfo()
{
// Draw blur redaction over sensitive areas
await ImageEditor.DrawRedactAsync(
RedactType.Blur,
startX: 100, startY: 100,
width: 200, height: 50,
value: 30 // Blur intensity
);
// Draw pixelate redaction over other areas
await ImageEditor.DrawRedactAsync(
RedactType.Pixelate,
startX: 400, startY: 200,
width: 200, height: 50,
value: 20 // Pixel size
);
// Export redacted image
await ImageEditor.ExportAsync("redacted-document.png");
}
}<SfImageEditor @ref="ImageEditor" Height="500px">
<ImageEditorEvents Created="OnCreated"></ImageEditorEvents>
</SfImageEditor>
@code {
SfImageEditor ImageEditor;
private async Task ApplyPhotoFrame()
{
// Load portrait image
await ImageEditor.OpenAsync("portrait.jpg");
// Apply classic mat frame with gradient
await ImageEditor.DrawFrameAsync(
FrameType.Mat,
color: "#FFFFFF",
gradientColor: "#F5F5DC",
size: 50,
inset: 20
);
// Export framed image
await ImageEditor.ExportAsync("framed-portrait.png");
}
}