class BitmapImage
package feathers.controls
extends FeathersControl › MeasureSprite › ValidatingSprite
Displays BitmapData
as a Feathers UI component.
1.4.0
.See also:
Constructor
new(?source:BitmapData, pixelSnapping:PixelSnapping = AUTO, smoothing:Bool = false)
Creates a new BitmapImage
object.
1.4.0
.Variables
read onlyoriginalSourceHeight:Null<Float>
The original height of the bitmap data, measured in pixels. May return
null
, if the source
is null
.
1.4.0
.See also:
read onlyoriginalSourceWidth:Null<Float>
The original width of the source
asset, measured in pixels. May return
null
, if the source
is null
.
1.4.0
.See also:
scaleMode:StageScaleMode
Determines how the BitmapData
will be scaled within the width and
height of the BitmapImage
instance. Uses the same constants from
StageScaleMode
that are used to scale the OpenFL stage.
The following example maintains the aspect ratio of the asset, but displays no border, and may crop it to fit:
loader.scaleMode = StageScaleMode.NO_BORDER
1.4.0
.See also:
source:BitmapData
Sets the image's source BitmapData
.
The following example sets the source to a BitmapData
asset:
var bmd = Assets.getBitmapData("my-asset-name");
loader.source = bmd;
1.4.0
.sourceScale:Float
Scales the source content for measurement. For example, if assets are designed for a scale factor of 2.0, they can be displayed at 0.5 scale to appear crisp (because displays bitmaps at the original dimensions, as if the scale factor were 1.0).
loader.sourceScale = 0.5;
1.4.0
.