[]
Paint tools toolbar panel.
unknown<PaintToolbarProps, PaintToolbarState>get brushHardness(): number;
Brush hardness.
number
get brushOpacity(): number;
Brush opacity.
number
get brushSize(): number;
Brush size.
number
get cloneStampHardness(): number;
Clone Stamp hardness.
number
get cloneStampOpacity(): number;
Clone Stamp opacity.
number
get cloneStampSize(): number;
Clone Stamp size.
number
get eraserHardness(): number;
Eraser hardness.
number
get eraserOpacity(): number;
Eraser opacity.
number
get eraserSize(): number;
Eraser size.
number
get fontBold(): boolean;
Bold font style.
boolean
get fontItalic(): boolean;
Italic font style.
boolean
get fontName(): string;
Font name.
string
get fontOpacity(): number;
Font opacity.
number
get fontSize(): number;
Font size.
number
get foreColor(): Color;
Pencil color.
Color
get maxHeight(): number;
Max possible crop height.
number
get maxWidth(): number;
Max possible crop width.
number
get naturalRatio(): number;
Natural aspect ratio.
number
get paintLayer(): IImageLayer;
Gets the paint layer containing the HTML canvas for drawing the image.
get pencilOpacity(): number;
Pencil opacity.
number
get penSize(): number;
Pencil size.
number
get selectedToolKey(): PaintToolType;
Selected tool type.
get toolHardness(): number;
Tool hardness.
number
get toolOpacity(): number;
Tool opacity.
number
get toolSize(): number;
Tool size.
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
static showDialog(paintToolsPlugin): void;
Show toolbar.
void
cancelChanges(): Promise<boolean | void>;
Called when parent viewer requests cancel changes, usually when the ESCAPE key is pressed.
Promise<boolean | void>
IViewerTransactionSupport.cancelChanges
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
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.
ensurePaintLayerReady(): Promise<IImageLayer>;
Call this method to create paint layer.
Promise<IImageLayer>
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
findObjectDesigner(id): IPaintObjectDesigner;
Finds a paint object designer by its unique identifier.
string
The unique identifier of the paint object designer.
The matching designer if found, otherwise undefined.
getHeight(): number;
Crop height.
number
getPaintObjectDesigners(): IPaintObjectDesigner[];
Get a reference to an array with object designers.
IPaintDesignerContext.getPaintObjectDesigners
getWidth(): number;
Crop width.
number
getX(): number;
Crop x position.
number
getY(): number;
Crop y position.
number
hide(): void;
Hide toolbar.
void
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
importCommandsFromFile(): Promise<IPaintCommand[]>;
Opens a file dialog to load commands from a JSON file
Promise<IPaintCommand[]>
Promise resolving with loaded commands
onPaintObjectPropertyChanged(
propertyName,
val,
dirty?): void;
Called when paint object property changed.
any
boolean
void
redoTransactionStep(): boolean | void;
Redo viewer transaction step. Return true if redo operation is consumed.
boolean | void
IViewerTransactionSupport.redoTransactionStep
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.
show(): void;
Show toolbar.
void
toggleTool(toolKey?, checked?): Promise<void>;
Toggle active paint tool.
Optional. Tool type.
boolean
Optional. Checked state.
Promise<void>
undoPaint(endIndex?): Promise<void>;
number
Optional. End undo index (excluding).
Promise<void>
undoTransactionStep(): boolean | void;
Undo viewer transaction step. Return true if undo operation is consumed.
boolean | void