BitmapData (flash.display.BitmapData)
299
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
fillColor
parameter, every pixel in the bitmap is set to that color.
By default, the bitmap is created as opaque, unless you pass the value
true
for the
transparent
parameter. Once you create an opaque bitmap, you cannot change it to a
transparent bitmap. Every pixel in an opaque bitmap uses only 24 bits of color channel
information. If you define the bitmap as
transparent
, every pixel uses 32 bits of color
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
width
:Number
- The width of the bitmap image in pixels.
height
:Number
- The height of the bitmap image in pixels.
transparent
:Boolean
[optional] - Specifies whether the bitmap image supports per-pixel
transparency. The default value is
true
(transparent). To create a fully transparent bitmap set
the value of the
transparent
parameter to
true
and the value of the
fillColor
parameter
to
0x00000000
(or to 0).
fillColor
:Number
[optional] - A 32-bit ARGB color value that you use to fill the bitmap
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
transparent
and
fillColor
parameters; you could call the constructor
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);
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...