Syncfusion React Image Editor

syncfusion/react-ui-components-skills/skills/syncfusion-react-image-editor

作者 syncfusion6fb1c883a8412b611b95f839e0cb06e1fc8170a8无许可证收录于 2026年10月9日更新于 2026年10月9日

Master Syncfusion React Image Editor for comprehensive image editing. Use this when users need to edit images, add annotations, apply filters, manage layers, or implement image editing features. Supports multiple formats (PNG, JPEG, SVG, WEBP, BMP), annotations (text, shapes, freehand, images), effects (filters, finetune), and accessibility features.

AI 生成的概览

用于实现 Syncfusion React Image Editor 组件的参考指南,涵盖安装、编辑工具、标注、效果与无障碍支持。

功能
该技能是一份文档式指南,面向在 React 应用中集成 Syncfusion React Image Editor 组件的开发者。它引导代理查阅各参考文件,内容涵盖安装、打开与保存图片、裁剪、变换、缩放与平移、文本、形状、手绘与图片标注、滤镜、微调、撤销/重做、工具栏、边框、层级顺序、遮盖、调整尺寸、对话框、无障碍与本地化。同时列出关键属性、事件、支持的格式以及常见工作流模式。
适用场景
当需要构建或扩展使用 Syncfusion Image Editor 进行浏览器内图片编辑的 React 应用时使用。适用于添加标注、应用滤镜、裁剪或调整图片尺寸、自定义工具栏,或处理编辑器无障碍与本地化等任务。
运行要求
需要一个 React 项目,并安装 @syncfusion/ej2-react-image-editor 包及其主题 CSS。该技能不包含脚本,仅为说明与参考文档。图片可从本地文件、URL、base64 或 blob 加载,因此使用远程图片源时可能需要网络访问。

Implementing Syncfusion React Image Editor

The Syncfusion React Image Editor is a comprehensive, feature-rich component for editing images directly in your React applications. It provides an intuitive interface with powerful tools for transformations, annotations, effects, and more.

Component Overview

The Image Editor combines a canvas-based editing environment with a comprehensive toolbar and contextual tools. It supports:

  • Multiple Input Sources: Files, URLs, base64, blobs, file managers, treeviews
  • Rich Annotation Support: Text (with styling), shapes, freehand drawings, watermarks
  • Professional Effects: Filters and fine-tuning controls
  • Advanced Operations: Z-order management, redaction, frame decoration
  • Accessibility First: Full keyboard navigation, WCAG compliance, RTL support, 120+ localization keys
  • Flexible Integration: Standalone or within dialogs, with customizable toolbars

Documentation and Navigation Guide

🔹 API Reference

📄 Read: references/api.md [blocked]

  • Complete API documentation with all properties, methods, and events
  • Properties overview (core, toolbar, settings)
  • Methods for image operations, transformations, annotations
  • Events for lifecycle, interactions, effects, and toolbars
  • Enums and type definitions (ArrowheadType, FrameType, RedactType, etc.)
  • Complete working examples with verified method signatures

Getting Started

📄 Read: references/getting-started.md [blocked]

  • Installation with Vite and create-react-app
  • CSS imports and theme setup
  • Basic component initialization
  • Setting width, height, and initial rendering

Opening and Saving Images

📄 Read: references/opening-saving-images.md [blocked]

  • Open from file paths, URLs, base64 strings, blobs
  • Open from file uploader, file manager, and treeview
  • Save/export as PNG, JPEG, SVG, WEBP
  • Image dimensions and aspect ratio control
  • File opened, saving, and lifecycle events

Selection and Cropping

📄 Read: references/selection-cropping.md [blocked]

  • Insert custom, square, and circle selections
  • Crop with aspect ratios (2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 5:7, 7:5, 9:16, 16:9)
  • Crop method and selection events
  • Maintain original image size during cropping
  • Lock selection area during resizing

Transform: Rotate, Flip, and Straighten

📄 Read: references/transform-rotate-flip.md [blocked]

  • Rotate clockwise/counter-clockwise by degrees
  • Flip horizontally and vertically
  • Straighten images with fine degree adjustments (-45° to +45°)
  • Transform annotations along with image
  • Rotating and flipping events

Zoom and Pan Operations

📄 Read: references/zooming-panning.md [blocked]

  • Zoom in/out with configurable min/max factors
  • Pan when zoomed or during cropping
  • Zoom triggers (toolbar, pinch, mouse wheel, keyboard)
  • Zooming and panning events
  • Zoom point calculations

Text Annotations

📄 Read: references/text-annotations.md [blocked]

  • Add text with position, content, and font settings
  • Text styling (bold, italic, underline, strikethrough)
  • Font families, sizes, and colors
  • Multiline text with newline characters
  • Delete text annotations
  • Customize font color via shapeChanging event

Freehand Drawing

📄 Read: references/freehand-drawing.md [blocked]

  • Enable/disable freehand drawing mode
  • Customize stroke width and color
  • Delete freehand annotations
  • Adjust stroke during drawing via shapeChanging event

Shape Annotations

📄 Read: references/shape-annotations.md [blocked]

  • Draw rectangles, ellipses, lines, arrows, and paths
  • Customize shapes with stroke color, stroke width, and fill color
  • Rotate shapes with degree parameter
  • Delete shape annotations
  • Customize default stroke colors
  • Shape changing and customization events

Image Annotations

📄 Read: references/image-annotations.md [blocked]

  • Add images or icons as annotations
  • Control position, size, rotation, and opacity
  • Aspect ratio preservation
  • Watermarks and decorative elements

Filters

📄 Read: references/filters.md [blocked]

  • Apply predefined filters (Chrome, Cold, Warm, Grayscale, Sepia, Invert)
  • Image filtering event
  • Reset filter to original

Fine-Tuning

📄 Read: references/finetune.md [blocked]

  • Adjust brightness, contrast, saturation
  • Control hue, exposure, blur, opacity
  • Finetune value changing events
  • Real-time adjustments with sliders

Undo and Redo

📄 Read: references/undo-redo.md [blocked]

  • Undo/redo operations with 16-step history
  • Keyboard shortcuts (Ctrl+Z, Ctrl+Y)
  • History management and limits

Toolbar Customization

📄 Read: references/toolbar-customization.md [blocked]

  • Built-in toolbar items (20+ default tools)
  • Add, remove, enable, disable toolbar items
  • Custom toolbar items with event handlers
  • Contextual toolbar for annotations
  • Toolbar templates for complete customization
  • Toolbar created and item clicked events

Quick Access Toolbar

📄 Read: references/quick-access-toolbar.md [blocked]

  • Quick access toolbar for annotations
  • Show/hide quick access toolbar
  • Add custom items to quick access toolbar
  • Quick access toolbar open event

Resize Image

📄 Read: references/resize-image.md [blocked]

  • Resize with or without aspect ratio
  • Width and height parameters
  • Resizing event with before/after dimensions

Frame Decoration

📄 Read: references/frame-decoration.md [blocked]

  • Apply frames (Mat, Bevel, Line, Inset, Hook)
  • Customize frame color, size, and line style
  • Frame changing event

Z-Order Layering

📄 Read: references/z-order-layering.md [blocked]

  • Bring forward/send backward annotations
  • Bring to front/send to back
  • Manage annotation layer order

Redact Sensitive Information

📄 Read: references/redact-sensitive-info.md [blocked]

  • Blur sensitive areas
  • Pixelate sensitive information
  • Redact CRUD operations (select, update, delete, get)
  • Privacy and compliance

Accessibility and Localization

📄 Read: references/accessibility-localization.md [blocked]

  • WCAG 2.2, Section 508 compliance
  • Screen reader support
  • Keyboard shortcuts (Ctrl+Z, Ctrl+S, Ctrl+O, Delete, Enter, Escape)
  • RTL language support
  • Localization with 120+ locale keys

Image Restrictions and Validation

📄 Read: references/image-restrictions-validation.md [blocked]

  • Allowed file extensions (.jpg, .png, .svg, .webp, .bmp)
  • Min and max file size restrictions
  • File validation and error alerts

Clear Image

📄 Read: references/clear-image.md [blocked]

  • Clear editor state
  • Dialog reuse patterns
  • Remove previously loaded images

Fit to Width and Height

📄 Read: references/fit-width-height.md [blocked]

  • Fit image to editor container width
  • Fit image to editor container height
  • Zoom calculations for perfect fit

Render in Dialog

📄 Read: references/render-in-dialog.md [blocked]

  • Render Image Editor within Dialog component
  • Content template integration
  • Dialog show/hide patterns

Reset Image

📄 Read: references/reset-image.md [blocked]

  • Reset all modifications to original state
  • Restore unmodified version
  • Clear annotations and effects

Quick Start Example

tsx
import { ImageEditorComponent } from '@syncfusion/ej2-react-image-editor';import React from 'react';
function App() {  let imgObj: ImageEditorComponent;
  function imageEditorCreated(): void {    imgObj.open('https://ej2.syncfusion.com/react/documentation/image-editor/images/bridge.jpeg');  }
  return (    <div>      <ImageEditorComponent        ref={(img) => { imgObj = img }}        width="550px"        height="350px"        created={imageEditorCreated}      />    </div>  );}
export default App;

Common Patterns

Pattern 1: Open + Edit + Save Workflow

  1. Open image via open() method
  2. Apply transformations, annotations, or effects
  3. Use export() to save as PNG/JPEG/SVG/WEBP
  4. Optionally convert to base64 or blob for backend storage

Pattern 2: Responsive Toolbar

  1. Define custom toolbar items in toolbar property
  2. Handle clicks via toolbarItemClicked event
  3. Execute methods like rotate(), zoom(), drawText() based on clicked item
  4. Update contextual toolbar via toolbarUpdating event

Pattern 3: Annotation Workflow

  1. Enable annotation mode (freehand, text, shape)
  2. Customize via shapeChanging event (color, stroke, font)
  3. Delete via deleteShape() with shape ID
  4. Manage layers via z-order methods

Pattern 4: Dialog Integration

  1. Render Image Editor in Dialog's content template
  2. Load image when dialog opens via fileOpened event
  3. Call clearImage() before closing dialog
  4. Retrieve edited image data via export() or getImageData()

Pattern 5: Filter + Finetune Pipeline

  1. Apply filter via applyImageFilter()
  2. Fine-tune via finetuneImage() (brightness, contrast, etc.)
  3. Listen to imageFiltering and finetuneValueChanging events
  4. Combine effects for professional results

Key Properties

PropertyTypePurpose
widthstringEditor canvas width (e.g., "550px", "100%")
heightstringEditor canvas height (e.g., "350px", "100%")
toolbararrayCustomize toolbar items and visibility
fontFamilyobjectAdd custom font families
uploadSettingsobjectConfigure file restrictions (extensions, size)
zoomSettingsobjectSet min/max zoom factors
showQuickAccessToolbarbooleanShow/hide quick access toolbar
localestringSet localization (e.g., 'de-DE')

Key Events

EventTriggerUse Case
createdComponent initializedLoad image on startup
fileOpenedImage loadedAdd watermarks, apply defaults
beforeSaveBefore exportValidate, add metadata
croppingDuring cropPrevent scaling, lock dimensions
zoomingDuring zoomValidate zoom level
rotatingDuring rotateTrack rotation angle
shapeChangingAnnotation modifiedCustomize stroke, font
toolbarUpdatingToolbar renderedAdd/remove contextual items

Supported File Formats

Open: PNG, JPEG, JPG, SVG, WEBP, BMP (local, URL, base64, blob) Save/Export: PNG, JPEG, SVG, WEBP

Next Steps

  • Start with getting-started.md [blocked] for setup
  • Explore opening-saving-images.md [blocked] to understand data flow
  • Check specific features in their dedicated reference files
  • Use accessibility-localization.md [blocked] for multi-language support

来源与署名

来源:syncfusion/react-ui-components-skills位于skills/syncfusion-react-image-editor提交6fb1c88

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架