Language Reference Guide : 4. System Classes : SpriteDescriptor Class : SpriteImage Method
 
Share this page                  
SpriteImage Method
The SpriteImage method returns the sprite corresponding to this sprite descriptor (curobject).
The returned image displays the sprite as it would be displayed on the passed displayfield if the underlying background matched the sprite’s transparency color. The passed field need not be actually displayed: you can supply a proxy field with its BgBitmap set to the relevant bitmap instead.
Two other versions of the sprite can be returned byref: the source image from which the sprite is derived, and (if the displayfield is visible) the actual displayed sprite, captured from the desktop. The x and y display coordinates of the sprite are also returned byref.
This event has the following syntax:
BitmapObject = SpriteDescriptor.SpriteImage(displayfield = ActiveField
          [, spritesource = Byref(BitmapObject)]
          [, displayedsprite = Byref(BitmapObject)]
          [, x = Byref(integer)][, y = Byref(integer)])
This method has the following parameters:
displayfield
(Required) Specifies the field to which the sprite belongs.
This field need not be displayed, but must have a BgBitmap that contains a sprite source image corresponding to the sprite defined in the descriptor. For example, if the descriptor specifies a SpriteSourceIndex of 2, there must be at least 2 sprite source images in the BgBitmap.
spritesource
Specifies, when returned byref, a copy of the sprite source image from which the sprite is derived.
displayedsprite
Specifies, when returned byref, a copy of the actual displayed sprite captured from the desktop. If the displayfield is not actually displayed, this parameter will be unchanged.
x
Specifies, when returned byref, the x-location of the sprite relative to the field, in pixels.
y
Specifies, when returned byref, the y-location of the sprite relative to the field, in pixels.
The method returns the sprite corresponding to the passed descriptor, or null if no sprite corresponds.