Class: HTMLDrawer

OpenSeadragon.HTMLDrawer

HTML-based implementation of DrawerBase for an OpenSeadragon.Viewer.

Constructor

new HTMLDrawer(options)

Parameters:
Name Type Description
options Object Options for this Drawer.
Properties
Name Type Attributes Description
viewer OpenSeadragon.Viewer The Viewer that owns this Drawer.
viewport OpenSeadragon.Viewport Reference to Viewer viewport.
element Element Parent element.
debugGridColor Number <optional>
See debugGridColor in OpenSeadragon.Options for details.
Source:

Extends

Members

canvas :Element

The HTML element (div) that this drawer uses for drawing
Type:
  • Element
Source:

container :Element

The parent element of this Drawer instance, passed in when the Drawer was created. The parent of OpenSeadragon.WebGLDrawer#canvas.
Type:
  • Element
Source:

Methods

(abstract) canRotate() → {Boolean}

Inherited From:
Source:
Returns:
True if rotation is supported.
Type
Boolean

(abstract) destroy()

Inherited From:
Source:

drawDebuggingRect(rect)

Optional public API to draw a rectangle (e.g. for debugging purposes) Child classes can override this method if they wish to support this
Parameters:
Name Type Description
rect OpenSeadragon.Rect
Inherited From:
Source:

(abstract) getType() → {String|undefined}

Inherited From:
Source:
Returns:
What type of drawer this is. Must be overridden by extending classes.
Type
String | undefined

(abstract) setImageSmoothingEnabled(imageSmoothingEnabledopt)

Parameters:
Name Type Attributes Description
imageSmoothingEnabled Boolean <optional>
Whether or not the image is drawn smoothly on the canvas; see imageSmoothingEnabled in OpenSeadragon.Options for more explanation.
Inherited From:
Source:

viewportCoordToDrawerCoord(point) → {OpenSeadragon.Point}

This function converts the given point from to the drawer coordinate by multiplying it with the pixel density. This function does not take rotation into account, thus assuming provided point is at 0 degree.
Parameters:
Name Type Description
point OpenSeadragon.Point the pixel point to convert
Inherited From:
Source:
Returns:
Point in drawer coordinate system.
Type
OpenSeadragon.Point

viewportToDrawerRectangle(rectangle) → {OpenSeadragon.Rect}

Scale from OpenSeadragon viewer rectangle to drawer rectangle (ignoring rotation)
Parameters:
Name Type Description
rectangle OpenSeadragon.Rect The rectangle in viewport coordinate system.
Inherited From:
Source:
Returns:
Rectangle in drawer coordinate system.
Type
OpenSeadragon.Rect