[]
Paint tools toolbar panel.
Component<PaintToolbarProps, PaintToolbarState>get paintLayer(): IImageLayer;
Gets the paint layer containing the HTML canvas for drawing the image.
get selectedToolKey(): PaintToolType;
Selected tool type.
get foreColor(): Color;
Pencil color.
Color
get penSize(): number;
Pencil size.
number
get brushSize(): number;
Brush size.
number
get eraserSize(): number;
Eraser size.
number
get cloneStampSize(): number;
Clone Stamp size.
number
get fontSize(): number;
Font size.
number
get pencilOpacity(): number;
Pencil opacity.
number
get brushOpacity(): number;
Brush opacity.
number
get eraserOpacity(): number;
Eraser opacity.
number
get cloneStampOpacity(): number;
Clone Stamp opacity.
number
get fontOpacity(): number;
Font opacity.
number
get brushHardness(): number;
Brush hardness.
number
get eraserHardness(): number;
Eraser hardness.
number
get cloneStampHardness(): number;
Clone Stamp hardness.
number
get fontName(): string;
Font name.
string
get fontItalic(): boolean;
Italic font style.
boolean
get fontBold(): boolean;
Bold font style.
boolean
get maxWidth(): number;
Max possible crop width.
number
get maxHeight(): number;
Max possible crop height.
number
get naturalRatio(): number;
Natural aspect ratio.
number
get useOriginalImage(): boolean;
Use the original image as source while applying edits.
boolean
set useOriginalImage(value): void;
Use the original image as source while applying edits.
boolean
void
get toolSize(): number;
Tool size.
number
get toolHardness(): number;
Tool hardness.
number
get toolOpacity(): number;
Tool opacity.
number
static showDialog(paintToolsPlugin): void;
Show toolbar.
void
getPaintObjectDesigners(): IPaintObjectDesigner[];
Get a reference to an array with object designers.
IPaintDesignerContext.getPaintObjectDesigners
removeObjectDesigner(id): boolean;
Removes an object designer by its ID and disposes of it.
string
The ID of the object to remove.
boolean
True if the object was found and removed, false otherwise.
findObjectDesigner(id):
| undefined
| IPaintObjectDesigner;
Finds a paint object designer by its unique identifier.
string
The unique identifier of the paint object designer.
| undefined
| IPaintObjectDesigner
The matching designer if found, otherwise undefined.
getX(): number;
Crop x position.
number
getY(): number;
Crop y position.
number
getWidth(): number;
Crop width.
number
getHeight(): number;
Crop height.
number
ensurePaintLayerReady(): Promise<IImageLayer>;
Call this method to create paint layer.
Promise<IImageLayer>
toggleTool(toolKey?, checked?): Promise<void>;
Toggle active paint tool.
Optional. Tool type.
boolean
Optional. Checked state.
Promise<void>
onPaintObjectPropertyChanged(
propertyName,
val,
dirty?): void;
Called when paint object property changed.
any
boolean
void
show(): void;
Show toolbar.
void
hide(): void;
Hide toolbar.
void
undoPaint(endIndex?): Promise<void>;
number
Optional. End undo index (excluding).
Promise<void>
componentWillUnmount(): void;
Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as
cancelled network requests, or cleaning up any DOM elements created in componentDidMount.
void
Component.componentWillUnmount
componentDidMount(): void;
Called immediately after a component is mounted. Setting state here will trigger re-rendering.
void
Component.componentDidMount
confirmChanges(): Promise<void>;
Called when parent viewer requests confirm and apply changes, usually when the Ctrl+Enter or Enter key is pressed.
Promise<void>
IViewerTransactionSupport.confirmChanges
cancelChanges(): Promise<boolean | void>;
Called when parent viewer requests cancel changes, usually when the ESCAPE key is pressed.
Promise<boolean | void>
IViewerTransactionSupport.cancelChanges
undoTransactionStep(): boolean | void;
Undo viewer transaction step. Return true if undo operation is consumed.
boolean | void
IViewerTransactionSupport.undoTransactionStep
redoTransactionStep(): boolean | void;
Redo viewer transaction step. Return true if redo operation is consumed.
boolean | void
IViewerTransactionSupport.redoTransactionStep
downloadCommandStack(args): Promise<void>;
Serializes and downloads the current command stack as a JSON file. If the browser supports the File System Access API, a native "Save as..." dialog will be used (user can edit the filename). Otherwise the method falls back to creating a Blob and triggering a download via an anchor element (with an optional prompt).
Options for export. objectsOnly: true will attempt to export only object-related commands.
boolean
Promise<void>
Resolves when the download/save operation is initiated or completed.
When serialization or file writing fails.
importCommandsFromFile(): Promise<IPaintCommand[]>;
Opens a file dialog to load commands from a JSON file
Promise<IPaintCommand[]>
Promise resolving with loaded commands
exportCommands(commands): string;
Serializes an array of paint commands to a JSON string
Array of paint commands to serialize
string
JSON string representing the command stack
When invalid commands are provided
importCommands(serializedData): Promise<IPaintCommand[]>;
Deserializes a JSON string to an array of paint commands
string
JSON string containing serialized commands
Promise<IPaintCommand[]>
Array of reconstructed paint commands
When the data cannot be deserialized