Wikitude ARchitect v2.0 API Documentation

Wikitude ARchitect > AR > ImageResource
Filters

Class ImageResource - extends ARchitectObject

ImageRessource encapsulates an image file. An ImageResource is represented via a URI pointing to the image file. An Image has a width and a height, in pixels.

Immediately after object creation, the system will start downloading the image file onto the device.

Example:
var imageres = new AR.ImageResource("http://path.to.my/image/resource.png");

Constructor

ImageResource ( uri , options )
Parameters:
uri <string> The uri to the image file.
options <object> Setup-Parameters to customize additional object properties.

Accepted options-properties are
  • onLoaded
  • onError

Properties inherited from ARchitectObject:

Methods

getHeight

int getHeight ( )
Returns the height of the original image, in pixels. In case the image is not yet loaded (see ImageResource.onLoaded(), -1 will be returned.
Returns: int
the height of the image represented through the URI, in pixels.

getUri

string getUri ( )
Returns the uri to the ImageResource.
Returns: string
the uri to the ImageResource.

getWidth

int getWidth ( )
Returns the width of the original image, in pixels. In case the image is not yet loaded (see ImageResource.onLoaded(), -1 will be returned.
Returns: int
the width of the image represented through the URI, in pixels.

isLoaded

boolean isLoaded ( )
Allows checking if the ImageResource has already been loaded successfully.
Returns: boolean
  • true if the ImageResource is already loaded.
  • false if the ImageResource is not yet loaded.

onError

void onError ( )
The trigger will fire when the Image file could not be loaded.

The trigger is null by default, and will thus result in no action executed when the trigger fires. A developer can add custom functionality by assigning a custom function to onError.
Returns: void

onLoaded

void onLoaded ( width , height )
The trigger will fire when the Image file was loaded.

The trigger is null by default, and will thus result in no action executed when the trigger fires. A developer can add custom functionality by assigning a custom function to onLoaded.
Parameters:
width <int> the width of the ImageResource, in pixels.
height <int> the height of the ImageResource, in pixels.
Returns: void

Methods inherited from ARchitectObject:


Copyright © 2013 Wikitude GmbH. All rights reserved.