Skip to content

Class: LeaferImage

Implements

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new LeaferImage(config): LeaferImage

Parameters

NameType
configILeaferImageConfig

Returns

LeaferImage

Defined in

leafer/packages/image/image/src/LeaferImage.ts:37

Properties

innerId

Readonly innerId: number

Implementation of

ILeaferImage.innerId

Defined in

leafer/packages/image/image/src/LeaferImage.ts:12


view

view: any

Implementation of

ILeaferImage.view

Defined in

leafer/packages/image/image/src/LeaferImage.ts:15


width

width: number

Implementation of

ILeaferImage.width

Defined in

leafer/packages/image/image/src/LeaferImage.ts:17


height

height: number

Implementation of

ILeaferImage.height

Defined in

leafer/packages/image/image/src/LeaferImage.ts:18


isSVG

isSVG: boolean

Implementation of

ILeaferImage.isSVG

Defined in

leafer/packages/image/image/src/LeaferImage.ts:20


hasOpacityPixel

hasOpacityPixel: boolean

Implementation of

ILeaferImage.hasOpacityPixel

Defined in

leafer/packages/image/image/src/LeaferImage.ts:21


ready

ready: boolean

Implementation of

ILeaferImage.ready

Defined in

leafer/packages/image/image/src/LeaferImage.ts:25


error

error: IObject

Implementation of

ILeaferImage.error

Defined in

leafer/packages/image/image/src/LeaferImage.ts:26


loading

loading: boolean

Implementation of

ILeaferImage.loading

Defined in

leafer/packages/image/image/src/LeaferImage.ts:27


use

use: number = 0

Implementation of

ILeaferImage.use

Defined in

leafer/packages/image/image/src/LeaferImage.ts:29


config

config: ILeaferImageConfig

Implementation of

ILeaferImage.config

Defined in

leafer/packages/image/image/src/LeaferImage.ts:31


waitComplete

Protected waitComplete: IFunction[] = []

Defined in

leafer/packages/image/image/src/LeaferImage.ts:33


cache

Protected cache: ILeaferImageCacheCanvas

Defined in

leafer/packages/image/image/src/LeaferImage.ts:35

Accessors

url

get url(): string

Returns

string

Implementation of

ILeaferImage.url

Defined in

leafer/packages/image/image/src/LeaferImage.ts:13


completed

get completed(): boolean

Returns

boolean

Implementation of

ILeaferImage.completed

Defined in

leafer/packages/image/image/src/LeaferImage.ts:23

Methods

load

load(onSuccess?, onError?): number

Parameters

NameType
onSuccess?IFunction
onError?IFunction

Returns

number

Implementation of

ILeaferImage.load

Defined in

leafer/packages/image/image/src/LeaferImage.ts:44


unload

unload(index, stopEvent?): void

Parameters

NameType
indexnumber
stopEvent?boolean

Returns

void

Implementation of

ILeaferImage.unload

Defined in

leafer/packages/image/image/src/LeaferImage.ts:62


onComplete

onComplete(isSuccess): void

Parameters

NameType
isSuccessboolean

Returns

void

Defined in

leafer/packages/image/image/src/LeaferImage.ts:71


getCanvas

getCanvas(width, height, opacity?, _filters?): any

Parameters

NameType
widthnumber
heightnumber
opacity?number
_filters?IObject

Returns

any

Implementation of

ILeaferImage.getCanvas

Defined in

leafer/packages/image/image/src/LeaferImage.ts:87


getPattern

getPattern(canvas, repeat, transform?, paint?): CanvasPattern

Parameters

NameType
canvasany
repeatstring
transform?IMatrixData
paint?ILeaferImagePatternPaint

Returns

CanvasPattern

Implementation of

ILeaferImage.getPattern

Defined in

leafer/packages/image/image/src/LeaferImage.ts:107


destroy

destroy(): void

Returns

void

Implementation of

ILeaferImage.destroy

Defined in

leafer/packages/image/image/src/LeaferImage.ts:119

Released under the MIT License.