syncfusion-angular-image-editor

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Implementing Syncfusion Angular Image Editor

实现Syncfusion Angular Image Editor

The Syncfusion Angular Image Editor component provides a comprehensive, feature-rich solution for image editing and annotation. It allows developers to integrate professional image editing capabilities directly into Angular applications, supporting a wide range of editing operations including annotations, transformations, filtering, and more.
Syncfusion Angular Image Editor组件为图片编辑和注释提供了全面且功能丰富的解决方案。它允许开发者将专业的图片编辑功能直接集成到Angular应用中,支持包括注释、变换、滤镜等在内的多种编辑操作。

Component Overview

组件概述

The Image Editor is a powerful, standalone component that provides:
  • Complete image editing suite with 20+ built-in tools
  • Flexible annotation system supporting text, shapes, and freehand drawing
  • Advanced transformations including rotate, flip, straighten, zoom, and pan
  • Professional image filters (cold, warm, chrome, sepia, invert, grayscale, etc.)
  • Fine-tuning controls for brightness, contrast, saturation, hue, exposure, blur, and opacity
  • Frame application with multiple frame types and customization options
  • Redaction tools for privacy protection (blur and pixelate)
  • Multiple input/output options including local files, base64, blob, file uploader, and file manager
  • Rich undo/redo history (16 steps maximum)
  • Fully customizable toolbars with contextual and quick-access options
  • Z-order management for annotation layering
  • Mobile-friendly with touch gestures (pinch zoom)
  • Full accessibility support including WCAG 2.2, keyboard navigation, and screen reader compatibility
  • Multi-language support with 150+ localization keywords
Image Editor是一个功能强大的独立组件,提供以下功能:
  • 完整的图片编辑套件,包含20+内置工具
  • 灵活的注释系统,支持文本、形状和手绘
  • 高级变换操作,包括旋转、翻转、拉直、缩放和平移
  • 专业图片滤镜(冷色调、暖色调、铬黄、深褐、反色、灰度等)
  • 精细调节控件,可调整亮度、对比度、饱和度、色调、曝光度、模糊度和透明度
  • 边框应用,提供多种边框类型和定制选项
  • 脱敏工具,用于隐私保护(模糊和像素化)
  • 多种输入/输出选项,包括本地文件、base64、blob、文件上传器和文件管理器
  • 丰富的撤销/重做历史记录(最多16步)
  • 完全可定制的工具栏,支持上下文和快速访问选项
  • 注释层级管理(Z-order)
  • 移动端友好,支持触摸手势(捏合缩放)
  • 全面的无障碍支持,包括WCAG 2.2、键盘导航和屏幕阅读器兼容性
  • 多语言支持,包含150+本地化关键词

Documentation and Navigation Guide

文档与导航指南

Getting Started & Installation

入门与安装

📄 Read: references/getting-started.md
  • Installation and package setup
  • Dependencies and module imports
  • Basic component implementation
  • CSS imports and theme configuration
  • First render and initialization
📄 阅读: references/getting-started.md
  • 安装与包配置
  • 依赖项与模块导入
  • 基础组件实现
  • CSS导入与主题配置
  • 首次渲染与初始化

Annotations & Drawing

注释与绘图

📄 Read: references/annotations.md
  • Text annotations with formatting (bold, italic, underline, strikethrough)
  • Multiline text support
  • Font family and text color customization
  • Freehand drawing with stroke adjustment
  • Shape annotations (rectangles, ellipses, lines, arrows, paths)
  • Image annotations and watermarking
  • Deleting and managing annotations
  • Shape styling and default customization
📄 阅读: references/annotations.md
  • 带格式的文本注释(粗体、斜体、下划线、删除线)
  • 多行文本支持
  • 字体家族与文本颜色定制
  • 可调整笔触的手绘功能
  • 形状注释(矩形、椭圆、线条、箭头、路径)
  • 图片注释与水印添加
  • 注释的删除与管理
  • 形状样式与默认设置定制

Selection & Cropping

选择与裁剪

📄 Read: references/selection-and-cropping.md
  • Custom selection shapes
  • Square and circle selections
  • Aspect ratio selections (2:3, 3:2, 4:3, 16:9, etc.)
  • Cropping selected regions
  • Selection event handling
  • Locking selection areas
  • Custom ratio selection during cropping
📄 阅读: references/selection-and-cropping.md
  • 自定义选择形状
  • 正方形与圆形选择
  • 固定比例选择(2:3、3:2、4:3、16:9等)
  • 裁剪选定区域
  • 选择事件处理
  • 锁定选择区域
  • 裁剪时自定义比例选择

Image Transformations

图片变换

📄 Read: references/transform.md
  • Rotating images (clockwise/counterclockwise)
  • Flipping horizontally and vertically
  • Straightening images with fine adjustments
  • Zooming in/out with min/max zoom levels
  • Panning functionality and events
  • Transform event handlers
  • Keyboard shortcuts for transformations
📄 阅读: references/transform.md
  • 图片旋转(顺时针/逆时针)
  • 水平与垂直翻转
  • 图片拉直与精细调整
  • 缩放(支持最小/最大缩放级别)
  • 平移功能与事件
  • 变换事件处理器
  • 变换操作的键盘快捷键

Filtering & Fine-tuning

滤镜与精细调节

📄 Read: references/filter-and-finetune.md
  • Applying image filters (Cold, Warm, Chrome, Sepia, Invert, Grayscale, Black & White)
  • Fine-tuning brightness and contrast
  • Adjusting saturation levels
  • Hue adjustments
  • Exposure control
  • Blur effects
  • Opacity adjustments
  • Filter and finetune event handling
📄 阅读: references/filter-and-finetune.md
  • 应用图片滤镜(冷色调、暖色调、铬黄、深褐、反色、灰度、黑白等)
  • 亮度与对比度精细调节
  • 饱和度调整
  • 色调调整
  • 曝光度控制
  • 模糊效果
  • 透明度调整
  • 滤镜与精细调节事件处理

Frame Application

边框应用

📄 Read: references/frames.md
  • Frame types (Mat, Bevel, Line, Hook, Inset)
  • Frame color customization
  • Gradient color support
  • Frame size and offset configuration
  • Border radius for line-type frames
  • Frame line styles (solid, dashed, dotted)
  • Frame changing events
📄 阅读: references/frames.md
  • 边框类型(衬边、斜角、线条、挂钩、内嵌)
  • 边框颜色定制
  • 渐变色支持
  • 边框尺寸与偏移配置
  • 线条型边框的圆角设置
  • 边框线条样式(实线、虚线、点线)
  • 边框切换事件

Redaction & Privacy

脱敏与隐私保护

📄 Read: references/redaction.md
  • Drawing redactions (blur and pixelate types)
  • Customizing redaction properties
  • Selecting specific redactions
  • Updating redaction settings
  • Deleting redactions
  • Retrieving redaction details
📄 阅读: references/redaction.md
  • 添加脱敏标记(模糊和像素化类型)
  • 定制脱敏属性
  • 选择特定脱敏标记
  • 更新脱敏设置
  • 删除脱敏标记
  • 获取脱敏详情

Open & Save Operations

打开与保存操作

📄 Read: references/open-and-save.md
  • Opening images from multiple sources (local, base64, blob, uploader, file manager, treeview)
  • Saving with format selection (PNG, JPEG, SVG, WEBP, BMP)
  • Image quality control for JPEG format
  • Exporting as different formats
  • Converting to base64, byte arrays, and blob
  • Watermark application during open/save
  • Custom save dialogs and server uploads
  • Image settings for custom dimensions
📄 阅读: references/open-and-save.md
  • 从多源打开图片(本地文件、base64、blob、上传器、文件管理器、树形视图)
  • 按格式选择保存(PNG、JPEG、SVG、WEBP、BMP)
  • JPEG格式的图片质量控制
  • 导出为不同格式
  • 转换为base64、字节数组和blob
  • 打开/保存时添加水印
  • 自定义保存对话框与服务器上传
  • 自定义尺寸的图片设置

Undo & Redo Operations

撤销与重做操作

📄 Read: references/undo-redo.md
  • Implementing undo functionality
  • Implementing redo functionality
  • Understanding history limitations (16 steps)
  • Keyboard shortcuts (Ctrl+Z, Ctrl+Y)
📄 阅读: references/undo-redo.md
  • 实现撤销功能
  • 实现重做功能
  • 了解历史记录限制(最多16步)
  • 键盘快捷键(Ctrl+Z、Ctrl+Y)

Toolbar Customization

工具栏定制

📄 Read: references/toolbar.md
  • Built-in toolbar items and their functions
  • Adding custom toolbar items
  • Showing/hiding toolbar
  • Enabling/disabling specific items
  • Contextual toolbar customization
  • Toolbar templates for complete customization
  • Toolbar events (toolbarCreated, toolbarItemClicked, toolbarUpdating)
📄 阅读: references/toolbar.md
  • 内置工具栏项及其功能
  • 添加自定义工具栏项
  • 显示/隐藏工具栏
  • 启用/禁用特定项
  • 上下文工具栏定制
  • 完全自定义的工具栏模板
  • 工具栏事件(toolbarCreated、toolbarItemClicked、toolbarUpdating)

Quick Access Toolbar

快速访问工具栏

📄 Read: references/quick-access-toolbar.md
  • Quick access toolbar visibility control
  • Adding custom items to quick access toolbar
  • Customizing annotation-specific actions
  • Event handling for toolbar operations
📄 阅读: references/quick-access-toolbar.md
  • 快速访问工具栏的可见性控制
  • 向快速访问工具栏添加自定义项
  • 定制注释相关的特定操作
  • 工具栏操作的事件处理

Z-Order & Layering

层级管理(Z-order)

📄 Read: references/z-order.md
  • Bringing annotations forward
  • Sending annotations backward
  • Bringing annotations to front
  • Sending annotations to back
  • Managing multiple annotation layers
📄 阅读: references/z-order.md
  • 将注释上移一层
  • 将注释下移一层
  • 将注释移至顶层
  • 将注释移至底层
  • 管理多注释层级

Accessibility & Compliance

无障碍支持与合规性

📄 Read: references/accessibility.md
  • WCAG 2.2 compliance standards
  • Keyboard shortcuts and navigation
  • Screen reader support
  • Color contrast standards
  • Mobile accessibility support
  • RTL (Right-to-Left) support
📄 阅读: references/accessibility.md
  • WCAG 2.2合规标准
  • 键盘快捷键与导航
  • 屏幕阅读器支持
  • 颜色对比度标准
  • 移动端无障碍支持
  • RTL(从右到左)布局支持

API Reference

API参考

📄 Read: references/api.md
  • Complete properties reference with types and defaults
  • All methods with parameters and return types
  • All events with descriptions
  • Event arguments reference
  • Filter, finetune, shape, and frame types
  • Selection shapes and export formats
  • Usage examples for properties and events
📄 阅读: references/api.md
  • 完整的属性参考(含类型与默认值)
  • 所有方法的参数与返回类型
  • 所有事件的描述
  • 事件参数参考
  • 滤镜、精细调节、形状与边框类型
  • 选择形状与导出格式
  • 属性与事件的使用示例

Localization

本地化

📄 Read: references/localization.md
  • Setting locale configuration
  • Customizing UI text in multiple languages
  • Translation keywords and values
  • Supporting international audiences
📄 阅读: references/localization.md
  • 设置区域配置
  • 定制多语言UI文本
  • 翻译关键词与对应值
  • 支持国际用户群体

Image Restrictions & Validation

图片限制与验证

📄 Read: references/image-restrictions.md
  • Specifying allowed file extensions
  • Setting minimum file size limits
  • Setting maximum file size limits
  • Validation error messages
  • Upload settings configuration
📄 阅读: references/image-restrictions.md
  • 指定允许的文件扩展名
  • 设置最小文件大小限制
  • 设置最大文件大小限制
  • 验证错误提示
  • 上传设置配置

Image Resizing

图片调整尺寸

📄 Read: references/resize.md
  • Resizing image dimensions
  • Aspect ratio preservation
  • Resize event handling
  • Custom dimension specifications
📄 阅读: references/resize.md
  • 调整图片尺寸
  • 保持宽高比
  • 尺寸调整事件处理
  • 自定义尺寸设置

End-User Capabilities

终端用户功能

📄 Read: references/end-user-capabilities.md
  • User-facing features and workflows
  • Opening images through UI
  • Zoom operations via toolbar, pinch, mouse wheel, keyboard
  • Panning functionality
  • Toolbar-based transformations
  • Annotation creation and editing
  • Filter and fine-tune application
  • Save and export workflows
📄 阅读: references/end-user-capabilities.md
  • 用户可见的功能与工作流
  • 通过UI打开图片
  • 通过工具栏、捏合手势、鼠标滚轮、键盘进行缩放操作
  • 平移功能
  • 基于工具栏的变换操作
  • 注释的创建与编辑
  • 滤镜与精细调节的应用
  • 保存与导出工作流

How-To Guides

操作指南

📄 Read: references/clear-image.md - Clearing editor state for dialog reuse
📄 Read: references/fit-to-width-height.md - Dynamic zoom fitting
📄 Read: references/render-in-dialog.md - Modal dialog integration
📄 Read: references/reset-image.md - Reverting to original state
📄 阅读: references/clear-image.md - 清除编辑器状态以复用对话框
📄 阅读: references/fit-to-width-height.md - 动态缩放适配
📄 阅读: references/render-in-dialog.md - 模态对话框集成
📄 阅读: references/reset-image.md - 恢复至原始状态

Quick Start Example

快速开始示例

typescript
import { Component } from '@angular/core';
import { ImageEditorModule } from '@syncfusion/ej2-angular-image-editor';

@Component({
  imports: [ImageEditorModule],
  standalone: true,
  selector: 'app-root',
  template: `
    <div style="width: 550px; height: 350px;">
      <ejs-imageeditor 
        #imageEditor
        [toolbar]="['Open', 'Undo', 'Redo', 'Crop', 'Annotate', 'Finetune', 'Filter', 'Resize', 'Save', 'Reset']"
      ></ejs-imageeditor>
    </div>
    <button (click)="openImage()">Open Image</button>
  `
})
export class AppComponent {
  @ViewChild('imageEditor') imageEditor: any;

  openImage() {
    this.imageEditor.open('path-to-image.png');
  }

  addAnnotation() {
    this.imageEditor.drawText(50, 50, 'Sample Text', 'Arial', 12, false, false, '#000000');
  }

  rotateImage() {
    this.imageEditor.rotate(90);
  }

  saveImage() {
    this.imageEditor.export('edited-image', 'png');
  }
}
typescript
import { Component } from '@angular/core';
import { ImageEditorModule } from '@syncfusion/ej2-angular-image-editor';

@Component({
  imports: [ImageEditorModule],
  standalone: true,
  selector: 'app-root',
  template: `
    <div style="width: 550px; height: 350px;">
      <ejs-imageeditor 
        #imageEditor
        [toolbar]="['Open', 'Undo', 'Redo', 'Crop', 'Annotate', 'Finetune', 'Filter', 'Resize', 'Save', 'Reset']"
      ></ejs-imageeditor>
    </div>
    <button (click)="openImage()">Open Image</button>
  `
})
export class AppComponent {
  @ViewChild('imageEditor') imageEditor: any;

  openImage() {
    this.imageEditor.open('path-to-image.png');
  }

  addAnnotation() {
    this.imageEditor.drawText(50, 50, 'Sample Text', 'Arial', 12, false, false, '#000000');
  }

  rotateImage() {
    this.imageEditor.rotate(90);
  }

  saveImage() {
    this.imageEditor.export('edited-image', 'png');
  }
}

Common Patterns

常用模式

Pattern 1: Open Image & Add Annotations

模式1:打开图片并添加注释

typescript
// Open image from file
this.imageEditor.open('image.png');

// Add text annotation
this.imageEditor.drawText(100, 100, 'Important', 'Arial', 16, true, false, '#FF0000');

// Add rectangle
this.imageEditor.drawRectangle(50, 50, 200, 150, 2, '#0000FF', '#FFFFFF');

// Add freehand drawing
this.imageEditor.freehandDraw();
typescript
// 从文件打开图片
this.imageEditor.open('image.png');

// 添加文本注释
this.imageEditor.drawText(100, 100, 'Important', 'Arial', 16, true, false, '#FF0000');

// 添加矩形
this.imageEditor.drawRectangle(50, 50, 200, 150, 2, '#0000FF', '#FFFFFF');

// 启用手绘
this.imageEditor.freehandDraw();

Pattern 2: Apply Filters & Fine-tuning

模式2:应用滤镜与精细调节

typescript
// Apply filter
this.imageEditor.applyImageFilter('Sepia');

// Fine-tune brightness
this.imageEditor.finetuneImage('Brightness', 50);

// Fine-tune contrast
this.imageEditor.finetuneImage('Contrast', -30);

// Fine-tune saturation
this.imageEditor.finetuneImage('Saturation', 40);
typescript
// 应用滤镜
this.imageEditor.applyImageFilter('Sepia');

// 精细调节亮度
this.imageEditor.finetuneImage('Brightness', 50);

// 精细调节对比度
this.imageEditor.finetuneImage('Contrast', -30);

// 精细调节饱和度
this.imageEditor.finetuneImage('Saturation', 40);

Pattern 3: Crop & Transform

模式3:裁剪与变换

typescript
// Select region for cropping
this.imageEditor.select('Custom', 50, 50, 300, 200);

// Crop the selected region
this.imageEditor.crop();

// Rotate after cropping
this.imageEditor.rotate(90);

// Flip horizontally
this.imageEditor.flip('Horizontal');
typescript
// 选择裁剪区域
this.imageEditor.select('Custom', 50, 50, 300, 200);

// 裁剪选定区域
this.imageEditor.crop();

// 裁剪后旋转
this.imageEditor.rotate(90);

// 水平翻转
this.imageEditor.flip('Horizontal');

Pattern 4: Customized Toolbar

模式4:定制工具栏

typescript
toolbar: [
  'Open',
  'Undo',
  'Redo',
  'Crop',
  'RotateLeft',
  'RotateRight',
  'HorizontalFlip',
  'VerticalFlip',
  'Annotate',
  'Finetune',
  'Filter',
  'Frame',
  'Redact',
  'Resize',
  'Save',
  'Reset'
];
typescript
toolbar: [
  'Open',
  'Undo',
  'Redo',
  'Crop',
  'RotateLeft',
  'RotateRight',
  'HorizontalFlip',
  'VerticalFlip',
  'Annotate',
  'Finetune',
  'Filter',
  'Frame',
  'Redact',
  'Resize',
  'Save',
  'Reset'
];

Pattern 5: Save with Different Formats

模式5:按不同格式保存

typescript
// Save as PNG (default)
this.imageEditor.export('myImage', 'png');

// Save as JPEG with quality
this.imageEditor.export('myImage', 'jpeg', 90);

// Get base64 data
const base64Data = this.imageEditor.getImageData();

// Save as blob
this.imageEditor.getImageData().then(data => {
  const blob = this.dataURLtoBlob(data);
  // Send to server
});
typescript
// 保存为PNG(默认格式)
this.imageEditor.export('myImage', 'png');

// 保存为指定质量的JPEG
this.imageEditor.export('myImage', 'jpeg', 90);

// 获取base64数据
const base64Data = this.imageEditor.getImageData();

// 保存为blob
this.imageEditor.getImageData().then(data => {
  const blob = this.dataURLtoBlob(data);
  // 上传至服务器
});

Key Props & Configuration

关键属性与配置

PropertyTypeDescriptionWhen to Use
toolbar
arrayList of toolbar items to displayCustomize visible tools
toolbarTemplate
templateCustom template for entire toolbarComplete toolbar redesign
uploadSettings
objectFile validation rules (extensions, size)Restrict upload formats/sizes
zoomSettings
objectMin/max zoom factor configurationControl zoom boundaries
fontFamily
arrayAdditional font families for textAdd custom fonts
locale
stringLanguage for UI textMulti-language support
height
string/numberComponent heightLayout sizing
width
string/numberComponent widthLayout sizing
showQuickAccessToolbar
booleanShow quick access toolbarControl quick toolbar visibility
属性类型描述使用场景
toolbar
数组要显示的工具栏项列表定制可见工具
toolbarTemplate
模板整个工具栏的自定义模板完全重设计工具栏
uploadSettings
对象文件验证规则(扩展名、大小)限制上传格式/大小
zoomSettings
对象最小/最大缩放比例配置控制缩放边界
fontFamily
数组文本注释的额外字体家族添加自定义字体
locale
字符串UI文本的语言设置多语言支持
height
字符串/数字组件高度布局尺寸设置
width
字符串/数字组件宽度布局尺寸设置
showQuickAccessToolbar
布尔值快速访问工具栏的可见性控制快速工具栏显示

Common Use Cases

常见用例

  1. Photo Editing App - Full-featured image editor with all tools
  2. Document Annotation - Highlight, mark, and comment on documents
  3. Social Media Content - Apply filters, frames, and text to images
  4. Privacy Protection - Redact sensitive information before sharing
  5. Profile Picture Editor - Crop, rotate, and apply filters to avatars
  6. Real Estate Listings - Rotate, frame, and annotate property photos
  7. Feedback & Collaboration - Annotate screenshots for team communication
  8. Template Design - Layer annotations with z-order for custom layouts
  9. Form Image Capture - Crop, rotate, and optimize mobile camera captures
  10. Watermark Application - Add text and image watermarks for branding
  1. 照片编辑应用 - 包含所有工具的全功能图片编辑器
  2. 文档注释 - 对文档进行高亮、标记与评论
  3. 社交媒体内容制作 - 为图片应用滤镜、边框与文本
  4. 隐私保护 - 分享前对敏感信息进行脱敏处理
  5. 头像编辑器 - 对头像进行裁剪、旋转与滤镜应用
  6. 房产列表配图 - 对房产照片进行旋转、加边框与注释
  7. 反馈与协作 - 为截图添加注释以实现团队沟通
  8. 模板设计 - 通过层级管理叠加注释以定制布局
  9. 表单图片采集 - 对移动端拍摄的图片进行裁剪、旋转与优化
  10. 水印添加 - 添加文本与图片水印以实现品牌标识

Reference Files

参考文件

All detailed documentation is organized by feature in the
references/
folder. Each reference file is self-contained and covers specific functionality in depth.
See individual reference files for code examples, event handling, and advanced configurations.
所有详细文档按功能分类存放在
references/
文件夹中。每个参考文件独立完整,深入覆盖特定功能。
如需代码示例、事件处理与高级配置,请查看各独立参考文件。