Packagesandy.util
Classpublic class BitmapUtil

Utility class for Bitmap calculations.



Public Methods
 MethodDefined by
  
concatBitmapMatrix(p_oM1:Object, p_oM2:Object):Object
[static] Returns a concatenation of two bitmap matrices.
BitmapUtil
  
getScaledBitmap(p_oBitmap:BitmapData, p_nScalex:Number, p_nScaley:Number = 0):BitmapData
[static] Returns a scaled version of a bitmap.
BitmapUtil
  
movieToBitmap(p_oSprite:Sprite, p_bTransparent:Boolean = true, p_nColor:Number = 0x00FF00CC):BitmapData
[static] Converts a sprite to a bitmap respecting the sprite position.
BitmapUtil
Method detail
concatBitmapMatrix()method
public static function concatBitmapMatrix(p_oM1:Object, p_oM2:Object):Object

Returns a concatenation of two bitmap matrices.

[ToDo: Explain what matrices are handled here ]

Parameters
p_oM1:Object — The matrix of the first bitmap.
 
p_oM2:Object — The matrix of the second bitmap.

Returns
Object — The resulting matrix.
getScaledBitmap()method 
public static function getScaledBitmap(p_oBitmap:BitmapData, p_nScalex:Number, p_nScaley:Number = 0):BitmapData

Returns a scaled version of a bitmap.

The method takes a bitmap as input, and returns a scaled copy.
The original is not changed.

Parameters
p_oBitmap:BitmapData — The bitmap to scale.
 
p_nScalex:Number — The x-scale.
 
p_nScaley:Number (default = 0) — The y-scale.

Returns
BitmapData — The scaled bitmap data.
movieToBitmap()method 
public static function movieToBitmap(p_oSprite:Sprite, p_bTransparent:Boolean = true, p_nColor:Number = 0x00FF00CC):BitmapData

Converts a sprite to a bitmap respecting the sprite position.

The simple BitmapData.draw method doesn't take care of the negative part of the sprite during the draw.
This method does.

Parameters
p_oSprite:Sprite — The sprite to convert.
 
p_bTransparent:Boolean (default = true) — Whether to allow transparency.
 
p_nColor:Number (default = 0x00FF00CC) — Background color (32 bit).

Returns
BitmapData — The converted bitmap.