Packagealternativa.utils
Classpublic class BitmapUtils

Utilites to work with raster images.



Public Methods
 MethodDefined by
  
getFragment(sourceBitmapData:BitmapData, rect:Rectangle):BitmapData
[static]Copy image fragment to a new raster image.
BitmapUtils
  
getNonTransparentRect(bitmapData:BitmapData):Rectangle
[static]Get non-transparent area bounding rectangle.
BitmapUtils
  
mergeBitmapAlpha(bitmapData:BitmapData, alphaBitmapData:BitmapData, dispose:Boolean = false):BitmapData
[static]Adding transparency to an image.
BitmapUtils
Method detail
getFragment()method
public static function getFragment(sourceBitmapData:BitmapData, rect:Rectangle):BitmapData

Copy image fragment to a new raster image.

Parameters
sourceBitmapData:BitmapDatasource image
 
rect:Rectanglefragment defining rectangle

Returns
BitmapDataThe new bitmap data containing specified fragment
getNonTransparentRect()method 
public static function getNonTransparentRect(bitmapData:BitmapData):Rectangle

Get non-transparent area bounding rectangle.

Parameters
bitmapData:BitmapDatasource image

Returns
Rectanglebounding rectangle for the opaque area of the image
mergeBitmapAlpha()method 
public static function mergeBitmapAlpha(bitmapData:BitmapData, alphaBitmapData:BitmapData, dispose:Boolean = false):BitmapData

Adding transparency to an image. Method creates a copy of an existing image and puts second image in it's alpha-channel.

Parameters
bitmapData:BitmapDataan image which opacity map is being applied to
 
alphaBitmapData:BitmapDatagrayscale image representing opacity map
 
dispose:Boolean (default = false)defines to delete source images or not

Returns
BitmapDatathe new bitmap data with applied alpha