ImageHelper

ImageHelper

A helper class to provide common functionality for working with Image objects

Constructor

new ImageHelper()

Source:

Methods

(static) compositeCanvasTexture(object, widthopt, heightopt, txopt, tyopt, centeropt) → {PIXI.Texture}

Source:

Composite a canvas object by rendering it to a single texture

Parameters:
Name Type Attributes Description
object PIXI.DisplayObject

The object to render to a texture

width number <optional>

The desired width of the output texture

height number <optional>

The desired height of the output texture

tx number <optional>

A horizontal translation to apply to the object

ty number <optional>

A vertical translation to apply to the object

center boolean <optional>

Center the texture in the rendered frame?

Returns:

The composite Texture object

Type
PIXI.Texture

(async, static) createThumbnail(src, options) → {Promise.<object>}

Source:

Create thumbnail preview for a provided image path.

Parameters:
Name Type Description
src string | PIXI.DisplayObject

The URL or display object of the texture to render to a thumbnail

options object

Additional named options passed to the compositeCanvasTexture function

Returns:

The parsed and converted thumbnail data

Type
Promise.<object>

(static) textureToImage(texture) → {string}

Source:

Extract a texture to a base64 PNG string

Parameters:
Name Type Description
texture PIXI.Texture

The texture object to extract

Returns:

A base64 png string of the texture

Type
string