BitmapData constructor
public BitmapData(width:Number, height:Number, [transparent:Boolean],
[fillColor:Number])
Creates a BitmapData object with a specified width and height. If you specify a value for the
parameter, every pixel in the bitmap is set to that color.
fillColor
By default, the bitmap is created as opaque, unless you pass the value
parameter. Once you create an opaque bitmap, you cannot change it to a
transparent
transparent bitmap. Every pixel in an opaque bitmap uses only 24 bits of color channel
information. If you define the bitmap as
channel information, including an alpha transparency channel.
The maximum width and maximum height of a BitmapData object is 2880 pixels. If you
specify a width or height value that is greater than 2880, a new instance is not created.
Availability: ActionScript 1.0; Flash Player 8
Parameters
- The width of the bitmap image in pixels.
width:Number
- The height of the bitmap image in pixels.
height:Number
transparent:Boolean
transparency. The default value is
the value of the
transparent
to
(or to 0).
0x00000000
[optional] - A 32-bit ARGB color value that you use to fill the bitmap
fillColor:Number
image area. The default value is 0xFFFFFFFF (solid white).
Example
The following example creates a new BitmapData object. The values in this example are the
default values for the
without these parameters and get the same result.
import flash.display.BitmapData;
var width:Number = 100;
var height:Number = 80;
var transparent:Boolean = true;
var fillColor:Number = 0xFFFFFFFF;
var bitmap_1:BitmapData = new BitmapData(width, height, transparent,
fillColor);
transparent
[optional] - Specifies whether the bitmap image supports per-pixel
(transparent). To create a fully transparent bitmap set
true
parameter to
and
transparent
fillColor
, every pixel uses 32 bits of color
and the value of the
true
parameters; you could call the constructor
BitmapData (flash.display.BitmapData)
for the
true
parameter
fillColor
299
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?