[]
PageToolsPlugin class. Adds the "Page tools" button.
<script src="gcimageviewer.js"></script></head>
<script src="plugins/pageTools.js"></script>
<script>
var viewer = new DsImageViewer("#root");
viewer.addPlugin(new PageToolsPlugin());
</script>
ImageViewerPluginBasenew PageToolsPlugin(options?): PageToolsPlugin;
PageToolsPlugin constructor.
plugin options
PageToolsPlugin
ImageViewerPluginBase.constructor
readonly id: PluginType;
Unique plugin identifier.
ImageViewerPluginBase.id
options: PageToolsPluginOptions;
Plugin options
get in17n(): i18n;
Gets the internationalization (i18n) instance from the viewer.
i18n
The i18n instance.
ImageViewerPluginBase.in17n
get isReady(): boolean;
Returns true if the image is loaded into the viewer and the image format is supported by the Page Tools plugin.
boolean
ImageViewerPluginBase.isReady
get naturalSize(): object;
Natural image size.
object
height: number;
width: number;
ImageViewerPluginBase.naturalSize
get paintLayer(): IImageLayer;
Gets the paint layer containing the HTML canvas for drawing the image.
ImageViewerPluginBase.paintLayer
get totalRotation(): number;
Gets current rotation in degrees.
number
get viewer(): IImageViewer;
Gets the image viewer instance.
The image viewer instance.
ImageViewerPluginBase.viewer
crop(
x,
y,
width,
height): Promise<boolean>;
Crop image.
number
number
number
number
Promise<boolean>
dispose(): void;
Cleans up resources and disposes the plugin.
void
ImageViewerPluginBase.dispose
flip(horizontal?, vertical?): Promise<boolean>;
Flip image.
boolean
boolean
Promise<boolean>
flipHorizontal(): Promise<boolean>;
Flip image horizontally.
Promise<boolean>
flipVertical(): Promise<boolean>;
Flip image vertically.
Promise<boolean>
initialize(viewer): void;
Initializes the plugin with the given image viewer.
any
The image viewer instance to associate with this plugin.
void
ImageViewerPluginBase.initialize
isImageFormatSupported(imageFormat, allowUnknown?): boolean;
Checks if the image format specified by the imageFormat parameter is supported.
string | ImageFormatCode
boolean
boolean
ImageViewerPluginBase.isImageFormatSupported
removePaintLayer(): void;
Removes and disposes the active paint layer. If no paint layer exists, this method does nothing.
void
ImageViewerPluginBase.removePaintLayer
resize(
width,
height,
keepAspectRatio?): Promise<boolean>;
Resize image.
number
number
boolean
Promise<boolean>
rotate(rotation): Promise<boolean>;
Rotate image.
number
Promise<boolean>