RasterSprite.setImage( image [, resize] )

Specifies the image displayed in this control. The argument can point to a single image file URL or be an instance of the IID_SPRITEINFO interface. Note: Use the RasterControl.setSize() method to specify the viewable area of this control.

An image URL might be prefixed by Raster resource-folder tag. The prefix "IMG:" is replaced with the current raster/images location, for example: "IMG:icon.gif" resolves to "$RASTER_HOME$/images/icon.gif". The prefix "CSS:" is replaced with the current css themes images location, for example: "CSS:icon.gif" resolves to "$RASTER_HOME$/themes/$THEME$/images/icon.gif".

Do not place a "/" between the prefix and the rest of the URL, as a forward slash will be inserted automatically. For configuring the RASTER_HOME and THEME use the Raster.config() method.


Name Type   Description
image string Either a string containing URL of an image file, or an object that implements the IID_SPRITEINFO interface.
resize boolean optional True makes the sprite's control to be resized to the size of image. This works only when image is of type IID_SPRITEINFO. False preserves the sprite's control current size (default).


Type Description
object The sprite object. This allow for chaining multiple setter methods in one single statement.
Home Examples Download License
Copyright © 2010-2017 Edwin R. López