mx.graphics

# BitmapFill - AS3 Flex

Package | mx.graphics
Class | public class BitmapFill
Inheritance | BitmapFill EventDispatcher Object
Implements | IFill

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

Defines a set of values used to fill an area on screen with a bitmap or other DisplayObject.

More examples

FXG
Paths in FXG and MXML graphics
Libraries and symbols in FXG and MXML graphics
Groups in FXG and MXML graphics
Shapes in FXG and MXML graphics
Text in FXG and MXML graphics
Fills in FXG and MXML graphics
Bitmap graphics in FXG and MXML graphics
Effects in FXG and MXML graphics

Learn more

Graphics classes and elements
MXML graphics

Related API Elements

mx.graphics.IFill
flash.display.Bitmap
flash.display.BitmapData
flash.display.DisplayObject

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | alpha : Number The transparency of a fill. | BitmapFill
|  | constructor : Object A reference to the class object or constructor function for a given object instance. | Object
|  | fillMode : String Determines how the bitmap fills in the dimensions. | BitmapFill
|  | matrix : Matrix An array of values used for matrix transformation. | BitmapFill
|  | offsetX : Number Deprecated since 4.0: Please Use x How far the bitmap is horizontally offset from the origin. | BitmapFill
|  | offsetY : Number Deprecated since 4.0: Please Use y How far the bitmap is vertically offset from the origin. | BitmapFill
|  | originX : Number Deprecated since 4.0: Please Use transformX The horizontal origin for the bitmap fill. | BitmapFill
|  | originY : Number Deprecated since 4.0: Please Use transformY The vertical origin for the bitmap fill. | BitmapFill
|  | repeat : Boolean Deprecated since 4.0: Please Use fillMode Whether the bitmap is repeated to fill the area. | BitmapFill
|  | rotation : Number The number of degrees to rotate the bitmap. | BitmapFill
|  | scaleX : Number The percent to horizontally scale the bitmap when filling, from 0.0 to 1.0. | BitmapFill
|  | scaleY : Number The percent to vertically scale the bitmap when filling, from 0.0 to 1.0. | BitmapFill
|  | smooth : Boolean A flag indicating whether to smooth the bitmap data when filling with it. | BitmapFill
|  | source : Object The source used for the bitmap fill. | BitmapFill
|  | transformX : Number The x position transform point of the fill. | BitmapFill
|  | transformY : Number The y position transform point of the fill. | BitmapFill
|  | x : Number The distance by which to translate each point along the x axis. | BitmapFill
|  | y : Number The distance by which to translate each point along the y axis. | BitmapFill

Protected Properties

| Property | Defined By
--- | --- | ---
|  | compoundTransform : mx.geom:CompoundTransform Holds the matrix and the convenience transform properties (x, y, and rotation). | BitmapFill

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | BitmapFill() Constructor. | BitmapFill
|  | addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event. | EventDispatcher
|  | dispatchEvent(event:Event):Boolean Dispatches an event into the event flow. | EventDispatcher
|  | hasEventListener(type:String):Boolean Checks whether the EventDispatcher object has any listeners registered for a specific type of event. | EventDispatcher
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void Removes a listener from the EventDispatcher object. | EventDispatcher
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String Returns the string representation of the specified object. | Object
|  | valueOf():Object Returns the primitive value of the specified object. | Object
|  | willTrigger(type:String):Boolean Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type. | EventDispatcher

Events
Click for more information on events
Hide Inherited Events
Show Inherited Events

| Event | Summary | Defined By
--- | --- | --- | ---
|  | activate | [broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active. | EventDispatcher
|  | deactivate | [broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive. | EventDispatcher

Property Detail

### alpha

property

`alpha:Number`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

The transparency of a fill. Possible values are 0.0 (invisible) through 1.0 (opaque).

The default value is `1.0..`

Implementation
`public function get alpha():Number`
`public function set alpha(value:Number):void`

### compoundTransform

property

`protected var compoundTransform:mx.geom:CompoundTransform`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

Holds the matrix and the convenience transform properties (`x`, `y`, and `rotation`). The compoundTransform is only created when the `matrix` property is set.

### fillMode

property

`fillMode:String`

Language Version: | ActionScript 3.0

Product Version: | Flex 4

Runtime Versions: | Flash Player 10, AIR 1.5

Determines how the bitmap fills in the dimensions. If you set the value of this property in a tag, use the string (such as "repeat"). If you set the value of this property in ActionScript, use the constant (such as `BitmapFillMode.CLIP`). When set to `BitmapFillMode.CLIP` ("clip"), the bitmap ends at the edge of the region. When set to `BitmapFillMode.REPEAT` ("repeat"), the bitmap repeats to fill the region. When set to `BitmapFillMode.SCALE` ("scale"), the bitmap stretches to fill the region.

The default value is ``BitmapFillMode.SCALE`.`

Implementation
`public function get fillMode():String`
`public function set fillMode(value:String):void`

### matrix

property

`matrix:Matrix`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

An array of values used for matrix transformation.

Implementation
`public function get matrix():Matrix`
`public function set matrix(value:Matrix):void`

### offsetX

property

`offsetX:Number`
Deprecated since 4.0: Please Use x

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

How far the bitmap is horizontally offset from the origin. This adjustment is performed after rotation and scaling.

The default value is `0.`

This property can be used as the source for data binding. When this property is modified, it dispatches the `propertyChange` event.

Implementation
`public function get offsetX():Number`
`public function set offsetX(value:Number):void`

### offsetY

property

`offsetY:Number`
Deprecated since 4.0: Please Use y

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

How far the bitmap is vertically offset from the origin. This adjustment is performed after rotation and scaling.

The default value is `0.`

This property can be used as the source for data binding. When this property is modified, it dispatches the `propertyChange` event.

Implementation
`public function get offsetY():Number`
`public function set offsetY(value:Number):void`

### originX

property

`originX:Number`
Deprecated since 4.0: Please Use transformX

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

The horizontal origin for the bitmap fill. The bitmap fill is offset so that this point appears at the origin. Scaling and rotation of the bitmap are performed around this point.

The default value is `0.`

This property can be used as the source for data binding. When this property is modified, it dispatches the `propertyChange` event.

Implementation
`public function get originX():Number`
`public function set originX(value:Number):void`

### originY

property

`originY:Number`
Deprecated since 4.0: Please Use transformY

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

The vertical origin for the bitmap fill. The bitmap fill is offset so that this point appears at the origin. Scaling and rotation of the bitmap are performed around this point.

The default value is `0.`

This property can be used as the source for data binding. When this property is modified, it dispatches the `propertyChange` event.

Implementation
`public function get originY():Number`
`public function set originY(value:Number):void`

### repeat

property

`repeat:Boolean`
Deprecated since 4.0: Please Use fillMode

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

Whether the bitmap is repeated to fill the area. Set to `true` to cause the fill to tile outward to the edges of the filled region. Set to `false` to end the fill at the edge of the region.

The default value is `true.`

This property can be used as the source for data binding. When this property is modified, it dispatches the `propertyChange` event.

Implementation
`public function get repeat():Boolean`
`public function set repeat(value:Boolean):void`

### rotation

property

`rotation:Number`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

The number of degrees to rotate the bitmap. Valid values range from 0.0 to 360.0.

The default value is `0.`

This property can be used as the source for data binding. When this property is modified, it dispatches the `propertyChange` event.

Implementation
`public function get rotation():Number`
`public function set rotation(value:Number):void`

### scaleX

property

`scaleX:Number`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

The percent to horizontally scale the bitmap when filling, from 0.0 to 1.0. If 1.0, the bitmap is filled at its natural size.

This property can be used as the source for data binding. When this property is modified, it dispatches the `propertyChange` event.

Implementation
`public function get scaleX():Number`
`public function set scaleX(value:Number):void`

### scaleY

property

`scaleY:Number`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

The percent to vertically scale the bitmap when filling, from 0.0 to 1.0. If 1.0, the bitmap is filled at its natural size.

This property can be used as the source for data binding. When this property is modified, it dispatches the `propertyChange` event.

Implementation
`public function get scaleY():Number`
`public function set scaleY(value:Number):void`

### smooth

property

`smooth:Boolean`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

A flag indicating whether to smooth the bitmap data when filling with it.

The default value is `false.`

This property can be used as the source for data binding. When this property is modified, it dispatches the `propertyChange` event.

Implementation
`public function get smooth():Boolean`
`public function set smooth(value:Boolean):void`

### source

property

`source:Object`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

The source used for the bitmap fill. The fill can render from various graphical sources, including the following:

- A Bitmap or BitmapData instance.
- A class representing a subclass of DisplayObject. The BitmapFill instantiates the class and creates a bitmap rendering of it.
- An instance of a DisplayObject. The BitmapFill copies it into a Bitmap for filling.

The default value is `null.`

Implementation
`public function get source():Object`
`public function set source(value:Object):void`

### transformX

property

`transformX:Number`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

The x position transform point of the fill.

Implementation
`public function get transformX():Number`
`public function set transformX(value:Number):void`

### transformY

property

`transformY:Number`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

The y position transform point of the fill.

Implementation
`public function get transformY():Number`
`public function set transformY(value:Number):void`

### x

property

`x:Number`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

The distance by which to translate each point along the x axis.

This property can be used as the source for data binding. When this property is modified, it dispatches the `propertyChange` event.

Implementation
`public function get x():Number`
`public function set x(value:Number):void`

### y

property

`y:Number`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

The distance by which to translate each point along the y axis.

This property can be used as the source for data binding. When this property is modified, it dispatches the `propertyChange` event.

Implementation
`public function get y():Number`
`public function set y(value:Number):void`
Constructor Detail

### BitmapFill

()
Constructor

`public function BitmapFill()`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

Constructor.

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00