| Package | qnx.ui.display |
| Class | public class Image |
| Inheritance | Image UIComponent flash.display.MovieClip |
Image class displays an image.
It can display an image by using a URL to an image, a Bitmap instance or a BitmapData instance.
See also
| Property | Defined By | ||
|---|---|---|---|
| cache : ImageCache
Gets or sets the ImageCache object to use to cache the image. | Image | ||
![]() | containment : String
Gets or sets a property that determines how a component is contained within a parent container. | UIComponent | |
| pixelSnapping : String
Controls whether or not the Bitmap object is snapped to the nearest pixel. | Image | ||
![]() | size : Number
Gets or sets the size for this component (as a percentage of the
container's size, or in pixels). | UIComponent | |
![]() | sizeMode : String
Gets or sets the size mode for this component. | UIComponent | |
![]() | sizeUnit : String
Gets or sets the unit of measure for the size property. | UIComponent | |
| smoothing : Boolean
Controls whether or not the bitmap is smoothed when scaled. | Image | ||
| Method | Defined By | ||
|---|---|---|---|
Image()
Constructs an Image instance. | Image | ||
![]() | destroy():void
Call this method when you want to have your object collected by the garbage collector. | UIComponent | |
![]() | drawNow():void
Calls the draw() method. | UIComponent | |
![]() | invalidate(property:String = all, invalidateNow:Boolean = false):void
Marks the property as invalid and the draw() method is called on the next frame or the next render, whichever comes first. | UIComponent | |
setImage(image:Object):void
Sets the image. | Image | ||
![]() | setPosition(x:Number, y:Number):void
Sets the x and y position of the component. | UIComponent | |
![]() | setSize(w:Number, h:Number):void
Sets the width and height of the component. | UIComponent | |
| Event | Summary | Defined By | ||
|---|---|---|---|---|
| Dispatched when the image is loaded and ready to be used. | Image | |||
| Dispatched when the image cannot be loaded. | Image | |||
| cache | property |
cache:ImageCache
Gets or sets the ImageCache object to use to cache the image.
public function get cache():ImageCache public function set cache(value:ImageCache):voidSee also
| pixelSnapping | property |
pixelSnapping:String
Controls whether or not the Bitmap object is snapped to the nearest pixel. The PixelSnapping class includes possible values:
PixelSnapping.NEVER—No pixel snapping occurs.PixelSnapping.ALWAYS—The image is always snapped to the nearest pixel, independent of transformation.PixelSnapping.AUTO—The image is snapped to the nearest pixel if it is drawn with no rotation or skew and it is drawn at a scale factor of 99.9% to 100.1%. If these conditions are satisfied, the bitmap image is drawn at 100% scale, snapped to the nearest pixel. Internally, this value allows the image to be drawn as fast as possible using the vector renderer. public function get pixelSnapping():String public function set pixelSnapping(value:String):void| smoothing | property |
smoothing:Boolean
Controls whether or not the bitmap is smoothed when scaled. If true, the bitmap is smoothed when scaled. If false, the bitmap is not smoothed when scaled.
public function get smoothing():Boolean public function set smoothing(value:Boolean):void| Image | () | Constructor |
public function Image()
Constructs an Image instance.
| setImage | () | method |
public function setImage(image:Object):void
Sets the image.
The image parameter can be of type String as a URL to an external image, Bitmap instance or a BitmapData instance.
Parameters
image:Object — The image to be set.
|
| complete | Event |
flash.events.Eventflash.events.Event.COMPLETEDispatched when the image is loaded and ready to be used.
| ioError | Event |
flash.events.IOErrorEventflash.events.IOErrorEvent.IO_ERRORDispatched when the image cannot be loaded.