[]
        
(Showing Draft Content)

RotationPlugin

Class: RotationPlugin

RotationPlugin class. Adds the "Rotate Image" button.

Deprecated

Deprecated in favor of PageToolsPlugin.

Description

Available options are:

  • rotatePosition - position of the "Rotate Image" button.
  • flipHorizontalPosition - position of the "Flip horizontal" button.
  • flipVerticalPosition - position of the "Flip vertical" button.

Example

<script src="gcimageviewer.js"></script></head>
<script src="plugins/rotation.js"></script>
<script>
  var viewer = new GcImageViewer("#root");
  viewer.addPlugin(new RotationPlugin());
</script>

Param

Extends

  • ImageViewerPluginBase

Constructors

Constructor

new RotationPlugin(options?): RotationPlugin;

RotationPlugin constructor.

Parameters

options?

RotationPluginOptions

Returns

RotationPlugin

Overrides

ImageViewerPluginBase.constructor

Properties

id

readonly id: PluginType;

Unique plugin identifier.

Overrides

ImageViewerPluginBase.id

options

options: RotationPluginOptions;

Plugin options

Accessors

in17n

Get Signature

get in17n(): i18n;

Gets the internationalization (i18n) instance from the viewer.

Returns

i18n

The i18n instance.

Inherited from

ImageViewerPluginBase.in17n

isReady

Get Signature

get isReady(): boolean;

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

Returns

boolean

Inherited from

ImageViewerPluginBase.isReady

naturalSize

Get Signature

get naturalSize(): object;

Natural image size.

Returns

object

height
height: number;
width
width: number;

Inherited from

ImageViewerPluginBase.naturalSize

paintLayer

Get Signature

get paintLayer(): IImageLayer;

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

Returns

IImageLayer

Inherited from

ImageViewerPluginBase.paintLayer

viewer

Get Signature

get viewer(): IImageViewer;

Gets the image viewer instance.

Returns

IImageViewer

The image viewer instance.

Inherited from

ImageViewerPluginBase.viewer

Methods

dispose()

dispose(): void;

Cleans up resources and disposes the plugin.

Returns

void

Overrides

ImageViewerPluginBase.dispose

flip()

flip(horizontal?, vertical?): Promise<boolean>;

Flip image.

Parameters

horizontal?

boolean

vertical?

boolean

Returns

Promise<boolean>


flipHorizontal()

flipHorizontal(): Promise<boolean>;

Flip image horizontally.

Returns

Promise<boolean>


flipVertical()

flipVertical(): Promise<boolean>;

Flip image vertically.

Returns

Promise<boolean>


getRotation()

getRotation(): number;

Specifies the rotation in degrees.

Returns

number


initialize()

initialize(viewer): void;

Initializes the plugin with the given image viewer.

Parameters

viewer

any

The image viewer instance to associate with this plugin.

Returns

void

Overrides

ImageViewerPluginBase.initialize

isImageFormatSupported()

isImageFormatSupported(imageFormat): boolean;

Checks if the image format specified by the imageFormat parameter is supported.

Parameters

imageFormat

string | ImageFormatCode

Returns

boolean

Overrides

ImageViewerPluginBase.isImageFormatSupported

removePaintLayer()

removePaintLayer(): void;

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

Returns

void

Inherited from

ImageViewerPluginBase.removePaintLayer

setRotation()

setRotation(val): Promise<boolean>;

Specifies the rotation in degrees.

Parameters

val

number

Returns

Promise<boolean>