[]
        
(Showing Draft Content)

PaintToolsPluginAPI

Interface: PaintToolsPluginAPI

Defines Paint Tools Plugin API.

Properties

id

id: PluginType;

Unique plug-in identifier.

Inherited from

ImageViewerPluginAPI.id

paintLayer

readonly paintLayer: ImageLayer;

Gets the paint layer containing the HTML canvas for drawing the image.

Inherited from

ImageViewerPluginAPI.paintLayer

isReady

readonly isReady: boolean;

Returns true if the image is loaded into the viewer and the image format is supported by the Image Filters plugin.

Inherited from

ImageViewerPluginAPI.isReady

naturalSize

readonly naturalSize: Size;

Natural image size.

Inherited from

ImageViewerPluginAPI.naturalSize

options

options: PaintToolsPluginOptions;

Plugin options


effectsToolbarLayout

readonly effectsToolbarLayout: ToolbarItemType[];

Returns the layout for the effects tools toolbar. If the value is true, undefined, or null, a default layout is returned. If the value is false, an empty layout is returned. Otherwise, the provided custom layout is used.

See


paintToolbarLayout

readonly paintToolbarLayout: ToolbarItemType[];

Returns the layout for the effects tools toolbar. If the value is true, undefined, or null, a default layout is returned. If the value is false, an empty layout is returned. Otherwise, the provided custom layout is used.

See


textToolbarLayout

readonly textToolbarLayout: ToolbarItemType[];

Returns the layout for the effects tools toolbar. If the value is true, undefined, or null, a default layout is returned. If the value is false, an empty layout is returned. Otherwise, the provided custom layout is used.

See


objectsToolbarLayout

readonly objectsToolbarLayout: ToolbarItemType[];

Returns the layout for the effects tools toolbar. If the value is true, undefined, or null, a default layout is returned. If the value is false, an empty layout is returned. Otherwise, the provided custom layout is used.

See

Methods

initialize()

initialize(viewer): void;

The method is called when the GcImageViewer component is initialized.

Parameters

viewer

ImageViewerAPI

Returns

void

Inherited from

ImageViewerPluginAPI.initialize

isImageFormatSupported()

isImageFormatSupported(imageFormat, allowUnknown?): boolean;

Determines whether the specified image format is supported for modifications.

Parameters

imageFormat

The image format to check, either as an enum value or string.

string | ImageFormatCode

allowUnknown?

boolean

If true, allows unknown formats (ImageFormatCode.Default) to be considered supported.

Returns

boolean

True if the format is supported for modifications, false otherwise.

Remarks

The following formats are explicitly not supported:

  • TIFF (ImageFormatCode.TIFF)
  • SVG (ImageFormatCode.SVG)
  • ICO (ImageFormatCode.ICO)
  • GIF (ImageFormatCode.GIF)

Examples

// Check if PNG is supported
const supported = isImageFormatSupported(ImageFormatCode.PNG);
// Check if an unknown format is supported (returns false by default)
const supported = isImageFormatSupported('custom-format');
// Check if an unknown format is supported (returns true when allowUnknown is true)
const supported = isImageFormatSupported('custom-format', true);

Inherited from

ImageViewerPluginAPI.isImageFormatSupported

dispose()

dispose(): void;

Cleans up resources and disposes the plugin.

Returns

void

Inherited from

ImageViewerPluginAPI.dispose

removePaintLayer()

removePaintLayer(): void;

Removes and disposes the active paint layer. If no paint layer exists, this method does nothing.

Returns

void

Inherited from

ImageViewerPluginAPI.removePaintLayer