dashset

ImageNode

extends Typesettable

An ImageNode represents an image (or, basically, anything with a fixed width and height).

There are three styles:

Note that the typesetter will not fetch the image; imageWidth and imageHeight must be set manually.

new ImageNode(context: Context?, properties: Object?)

This will create a new ImageNode with the specified context and properties. properties should just be an object with keys being the properties listed below.

Properties

context: Context

Default: null

The node’s typesetting context.

src: string

The image source URL. Note that typesetter will not fetch the image and the image size must be set manually.

imageWidth: number, imageHeight: number

Default: 0, 0

The image size in pixels; used for typesetting. This shouldn’t necessarily be the original image size but rather the desired image size.

style: number

Default: 0

The style must be one of the following:

type: string

The node type. For an image node, this should be image.

Methods

copyFrom(imageNode: ImageNode)

This will copy all properties from another ImageNode to this one.

typeset()

This will typeset this ImageNode.