Packagecom.afcomponents.umap.styles
Classpublic class BitmapStyle
InheritanceBitmapStyle Inheritance Style

Specifies a bitmap fill. This style used by a GeometryStyle class in the GeometryStyle.fillBitmap property.


Example
Here is quick example that shows the usage of BitmapStyle & GeometryStyle classes for creating a bitmap-filled rectangle:
 import com.afcomponents.umap.styles.GeometryStyle;
 import com.afcomponents.umap.styles.BitmapStyle;
 import flash.display.Sprite;
 import flash.display.BitmapData;
  
 // create checkered pattern
 var pattern:Sprite = new Sprite();
 with(pattern.graphics)
 {
  beginFill(0xFFCC00);
  drawRect(0,0,10,10);
  drawRect(10,10,10,10);
  beginFill(0x000000);
  drawRect(0,10,10,10);
  drawRect(10,0,10,10);
 }
  
 // create new bitmap from checkered pattern
 var bitmap:BitmapData = new BitmapData(pattern.width, pattern.height);
 bitmap.draw(pattern);
  
 // create new GeometryStyle with bitmap fill
 var style:GeometryStyle = new GeometryStyle();
 style.stroke = GeometryStyle.NONE;
 style.fill = GeometryStyle.BITMAP;
 style.fillBitmap = new BitmapStyle();
 style.fillBitmap.bitmap = bitmap;
  
 // apply geometry style to draw bitmap-filled rectangle
 style.applyTo(this.graphics);
 this.graphics.drawRect(0,0,100,100); 

You should see a bitmap-filled rectangle after executing the code:

BitmapStyle example

See also

GeometryStyle
GeometryStyle.fillBitmap
flash.display.Graphics


Public Properties
 PropertyDefined by
  bitmap : BitmapData = null
A transparent or opaque bitmap image that contains the bits to be displayed.
BitmapStyle
  matrix : Matrix = null
A matrix object (of the flash.geom.Matrix class), which you can use to define transformations on the bitmap.
BitmapStyle
  repeat : Boolean = true
Defines wether to repeat, or scale the bitmap.
BitmapStyle
  smooth : Boolean = true
Defines whether to use smoothing (bilinear algorithm) on the scaled bitmap.
BitmapStyle
Public Methods
 MethodDefined by
  
BitmapStyle(param:Object = null)
BitmapStyle contructor.
BitmapStyle
 Inherited
Creates a copy of the Style object.
Style
 Inherited
concat(param:Object):Style
Creates a clone of this Style, copies the properties from specified object and returns the new style.
Style
 Inherited
copy(object:Object):void
Copies all the properties from the specified object into the Style object.
Style
 Inherited
copyStyle(dest:Object, src:Object):void
[static] Copies all properties of one object into another.
Style
 Inherited
[static] Returns new Style object, from the source XML object.
Style
 Inherited
getXMLFromStyle(style:Style, name:String = ""):XML
[static] Returns an XML object that represents all the style's properties.
Style
 Inherited
toString():String
Returns a String that represents all the style's properties.
Style
 Inherited
toXML(afcTags:Boolean = false):XML
Abstract function.
Style
Property detail
bitmapproperty
public var bitmap:BitmapData = null

A transparent or opaque bitmap image that contains the bits to be displayed.

The default value is null.

See also

flash.display.BitmapData
matrixproperty 
public var matrix:Matrix = null

A matrix object (of the flash.geom.Matrix class), which you can use to define transformations on the bitmap.

For instance, you can use the following matrix to rotate a bitmap by 45 degrees (pi/4 radians):

  matrix = new flash.geom.Matrix(); 
  matrix.rotate(Math.PI/4);

The default value is null.

See also

flash.geom.Matrix
repeatproperty 
public var repeat:Boolean = true

Defines wether to repeat, or scale the bitmap.

If true, the bitmap image repeats in a tiled pattern. If false, the bitmap image does not repeat, and the edges of the bitmap are used for any fill area that extends beyond the bitmap.

The default value is true.

smoothproperty 
public var smooth:Boolean = true

Defines whether to use smoothing (bilinear algorithm) on the scaled bitmap.

If false, upscaled bitmap images are rendered by using a nearest-neighbor algorithm and look pixelated. If true, upscaled bitmap images are rendered by using a bilinear algorithm. Rendering by using the nearest neighbor algorithm is usually faster.

The default value is false.

Constructor detail
BitmapStyle()constructor
public function BitmapStyle(param:Object = null)

BitmapStyle contructor.

Creates new BitmapStyle object with the default parameters. Properties defined in param object will override the default values.

Parameters
param:Object (default = null) — Object that holds all the properites of a style you wish to override upon its creation.