-
Notifications
You must be signed in to change notification settings - Fork 164
ImageResize plugin
Go back to Built-in plugins
ImageResize
plugin provides the resizing functionality of an inline image. With this plugin user can resize an inline image by drag and drop the resizing handles of an inline image.
ImageResize
is an optional plugin. To use this plugin, you need to manually create instance of this plugin and add it to your editor by createEditor() API or constructor of Editor class. To manually create an instance of this plugin, you can use its constructor:
constructor(
private minWidth: number = 10,
private minHeight: number = 10,
private selectionBorderColor: string = '#DB626C',
private forcePreserveRatio: boolean = false
);
Minimum widht of the image during resize. Default value is 10px.
Minimum height of the image during resize. Default value is 10px.
Color of the resizing border and resizing handle. Default value is '#DB626C'.
Whether we want to force the inline image preserve its wdith/height ratio during resizing. Default value is false.
When finish resizing, this plugin will trigger a ContentChangedEvent with source equal to 'ImageResize` (ChangeSource.ImageResize).
For more inforation about ContentChangedEvent
, please reference to ContentChangedEvent
Package: roosterjs-plugin-image-resize
Support from: Support ImageResizePlugin from 6.4.1, renamed to ImageResize in 6.8.0
Source code: ImageResize.ts