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

Hierarchy

  • ImageViewerPluginBase
    • RotationPlugin

Accessors

  • get in17n(): i18n
  • Gets the internationalization (i18n) instance from the viewer.

    Returns

    The i18n instance.

    Returns i18n

  • get isReady(): boolean
  • Returns true if the image is loaded into the viewer and the image format is supported by the plugin.

    Returns boolean

  • get naturalSize(): { width: number; height: number }
  • Natural image size.

    Returns { width: number; height: number }

    • width: number
    • height: number
  • get paintLayer(): IImageLayer
  • Gets the paint layer containing the HTML canvas for drawing the image.

    Returns IImageLayer

  • get viewer(): IImageViewer
  • Gets the image viewer instance.

    Returns

    The image viewer instance.

    Returns IImageViewer

Methods

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

    Returns

    Returns void

  • Specifies the rotation in degrees.

    Returns number

  • Specifies the rotation in degrees.

    Parameters

    • val: number

    Returns Promise<boolean>

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

    Parameters

    Returns boolean

  • Flip image.

    Parameters

    • horizontal: boolean = true
    • vertical: boolean = false

    Returns Promise<boolean>

  • Flip image horizontally.

    Returns Promise<boolean>

  • Flip image vertically.

    Returns Promise<boolean>

Properties

id: PluginType = "rotation"

Unique plugin identifier.

Plugin options

Constructors