Skip to content

Interface: Image ​

Defined in: types/desktop-engine.d.ts:876

Image view component

Extends ​

Properties ​

children ​

ts
readonly children: AnyComponent[];

Defined in: types/desktop-engine.d.ts:597

Array of child components (each read returns a new array)

Inherited from ​

ComponentBase.children


height ​

ts
readonly height: number;

Defined in: types/desktop-engine.d.ts:595

Height after layout (reading triggers layout first)

Inherited from ​

ComponentBase.height


identifier ​

ts
readonly identifier: string;

Defined in: types/desktop-engine.d.ts:588

Unique identifier of the native component (a pointer string)

Inherited from ​

ComponentBase.identifier


onclick ​

ts
onclick: 
  | EventHandler<Image, ClickPayload>
  | null
  | undefined;

Defined in: types/desktop-engine.d.ts:608

click callback

Inherited from ​

ComponentBase.onclick


ondbclick ​

ts
ondbclick: 
  | EventHandler<Image, ClickPayload>
  | null
  | undefined;

Defined in: types/desktop-engine.d.ts:610

dbclick (double-click) callback

Inherited from ​

ComponentBase.ondbclick


onerror ​

ts
onerror: 
  | EventHandler<Image, ErrorPayload>
  | null
  | undefined;

Defined in: types/desktop-engine.d.ts:891

Called when a src can't be shown: a file that can't be read, a URL the image doesn't load (data: URLs, a path out of the package) or an http(s) URL without the "network" permission. A src replaced before it loaded calls neither callback.


onframechange ​

ts
onframechange: 
  | EventHandler<Image, FrameChangePayload>
  | null
  | undefined;

Defined in: types/desktop-engine.d.ts:606

framechange callback

Inherited from ​

ComponentBase.onframechange


onload ​

ts
onload: 
  | EventHandler<Image, void>
  | null
  | undefined;

Defined in: types/desktop-engine.d.ts:885

Called when the image of a src has loaded, once for each src set (the same one again too); changing position or size doesn't load it again


onmousedown ​

ts
onmousedown: 
  | EventHandler<Image, MousePayload>
  | null
  | undefined;

Defined in: types/desktop-engine.d.ts:612

mousedown callback

Inherited from ​

ComponentBase.onmousedown


onmouseenter ​

ts
onmouseenter: 
  | EventHandler<Image, MousePayload>
  | null
  | undefined;

Defined in: types/desktop-engine.d.ts:616

mouseenter callback

Inherited from ​

ComponentBase.onmouseenter


onmouseleave ​

ts
onmouseleave: 
  | EventHandler<Image, MousePayload>
  | null
  | undefined;

Defined in: types/desktop-engine.d.ts:618

mouseleave callback

Inherited from ​

ComponentBase.onmouseleave


onmousemove ​

ts
onmousemove: 
  | EventHandler<Image, MousePayload>
  | null
  | undefined;

Defined in: types/desktop-engine.d.ts:620

mousemove callback, also while a press that began on the component is dragged, unless the press moves the window (see Window.dragRegion)

Inherited from ​

ComponentBase.onmousemove


onmouseup ​

ts
onmouseup: 
  | EventHandler<Image, MousePayload>
  | null
  | undefined;

Defined in: types/desktop-engine.d.ts:614

mouseup callback

Inherited from ​

ComponentBase.onmouseup


onwheel ​

ts
onwheel: 
  | EventHandler<Image, WheelPayload>
  | null
  | undefined;

Defined in: types/desktop-engine.d.ts:622

wheel callback

Inherited from ​

ComponentBase.onwheel


position ​

ts
position: ImagePosition;

Defined in: types/desktop-engine.d.ts:882

Alignment


size ​

ts
size: ImageSize;

Defined in: types/desktop-engine.d.ts:880

Scaling mode


src ​

ts
src: string | null;

Defined in: types/desktop-engine.d.ts:878

Image source (returns the value as it was set)


width ​

ts
readonly width: number;

Defined in: types/desktop-engine.d.ts:593

Width after layout (reading triggers layout first)

Inherited from ​

ComponentBase.width

Accessors ​

style ​

Get Signature ​

ts
get style(): ComponentStyle;

Defined in: types/desktop-engine.d.ts:590

Reading returns the style object; assigning an object replaces the whole style

Returns ​

ComponentStyle

Set Signature ​

ts
set style(value): void;

Defined in: types/desktop-engine.d.ts:591

Parameters ​
ParameterType
valueStyleProperties
Returns ​

void

Inherited from ​

ComponentBase.style

Methods ​

addEventListener() ​

ts
addEventListener<K>(type, listener): void;

Defined in: types/desktop-engine.d.ts:128

Adds an event listener; type may be given with or without the on prefix

Type Parameters ​

Type Parameter
K extends | "error" | "framechange" | "click" | "dbclick" | "mousedown" | "mouseup" | "mouseenter" | "mouseleave" | "mousemove" | "wheel" | "load"

Parameters ​

ParameterType
typeK | `on${K}`
listenerEventHandler<Image, ImageEventMap[K]>

Returns ​

void

Inherited from ​

ComponentBase.addEventListener


appendChild() ​

ts
appendChild(child, index?): void;

Defined in: types/desktop-engine.d.ts:599

Adds a child component at index (0 to the number of children); omit it or pass -1 to append at the end. Throws a RangeError for other indexes; a Window can't be a child

Parameters ​

ParameterType
childAnyComponent
index?number

Returns ​

void

Inherited from ​

ComponentBase.appendChild


destroy() ​

ts
destroy(): void;

Defined in: types/desktop-engine.d.ts:132

Clears all event listeners and on callbacks so the object can be garbage-collected; components also process their children recursively

Returns ​

void

Inherited from ​

ComponentBase.destroy


offclick() ​

ts
offclick(): void;

Defined in: types/desktop-engine.d.ts:626

Removes the onclick callback

Returns ​

void

Inherited from ​

ComponentBase.offclick


offdbclick() ​

ts
offdbclick(): void;

Defined in: types/desktop-engine.d.ts:628

Removes the ondbclick callback

Returns ​

void

Inherited from ​

ComponentBase.offdbclick


offerror() ​

ts
offerror(): void;

Defined in: types/desktop-engine.d.ts:895

Removes the onerror callback

Returns ​

void


offframechange() ​

ts
offframechange(): void;

Defined in: types/desktop-engine.d.ts:624

Removes the onframechange callback

Returns ​

void

Inherited from ​

ComponentBase.offframechange


offload() ​

ts
offload(): void;

Defined in: types/desktop-engine.d.ts:893

Removes the onload callback

Returns ​

void


offmousedown() ​

ts
offmousedown(): void;

Defined in: types/desktop-engine.d.ts:630

Removes the onmousedown callback

Returns ​

void

Inherited from ​

ComponentBase.offmousedown


offmouseenter() ​

ts
offmouseenter(): void;

Defined in: types/desktop-engine.d.ts:634

Removes the onmouseenter callback

Returns ​

void

Inherited from ​

ComponentBase.offmouseenter


offmouseleave() ​

ts
offmouseleave(): void;

Defined in: types/desktop-engine.d.ts:636

Removes the onmouseleave callback

Returns ​

void

Inherited from ​

ComponentBase.offmouseleave


offmousemove() ​

ts
offmousemove(): void;

Defined in: types/desktop-engine.d.ts:638

Removes the onmousemove callback

Returns ​

void

Inherited from ​

ComponentBase.offmousemove


offmouseup() ​

ts
offmouseup(): void;

Defined in: types/desktop-engine.d.ts:632

Removes the onmouseup callback

Returns ​

void

Inherited from ​

ComponentBase.offmouseup


offwheel() ​

ts
offwheel(): void;

Defined in: types/desktop-engine.d.ts:640

Removes the onwheel callback

Returns ​

void

Inherited from ​

ComponentBase.offwheel


remove() ​

ts
remove(): void;

Defined in: types/desktop-engine.d.ts:603

Removes this component from its parent

Returns ​

void

Inherited from ​

ComponentBase.remove


removeChild() ​

ts
removeChild(child): void;

Defined in: types/desktop-engine.d.ts:601

Removes a child component; throws if it isn't a child of this component

Parameters ​

ParameterType
childAnyComponent

Returns ​

void

Inherited from ​

ComponentBase.removeChild


removeEventListener() ​

ts
removeEventListener<K>(type, listener): void;

Defined in: types/desktop-engine.d.ts:130

Removes the given event listener

Type Parameters ​

Type Parameter
K extends | "error" | "framechange" | "click" | "dbclick" | "mousedown" | "mouseup" | "mouseenter" | "mouseleave" | "mousemove" | "wheel" | "load"

Parameters ​

ParameterType
typeK | `on${K}`
listenerEventHandler<Image, ImageEventMap[K]>

Returns ​

void

Inherited from ​

ComponentBase.removeEventListener

The SDK is released under the Apache License 2.0