Flash CS3 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript classes > BitmapData (flash.display.BitmapData) | |||
Object
|
+-flash.display.BitmapData
public class BitmapData
extends Object
The BitmapData class lets you create arbitrarily sized transparent or opaque bitmap images and manipulate them in various ways at runtime.
This class lets you separate bitmap rendering operations from the Flash Player internal display updating routines. By manipulating a BitmapData object directly, you can create very complex images without incurring the per frame overhead of constantly redrawing the content from vector data.
The methods of the BitmapData class support a variety of effects that are not available through the generic filter interface.
A BitmapData object contains an array of pixel data. This data can represent either a fully opaque bitmap or a transparent bitmap that contains alpha channel data. Either type of BitmapData object is stored as a buffer of 32-bit integers. Each 32-bit integer determines the properties of a single pixel in the bitmap.
Each 32-bit integer is a combination of four 8-bit channel values (from 0 to 255) that describe the alpha transparency and the red, green, and blue (ARGB) values of the pixel.
The four channels (red, green, blue, and alpha) are represented as numbers when you use them with the BitmapData.copyChannel() method or the DisplacementMapFilter.componentX and DisplacementMapFilter.componentY properties, as follows:
1 (red)2 (green)4 (blue)8 (alpha)You can attach BitmapData objects to a MovieClip object by using the MovieClip.attachBitmap() method.
You can use a BitmapData object to fill an area in a movie clip by using the MovieClip.beginBitmapFill() method.
The maximum width and maximum height of a BitmapData object is 2880 pixels.
Calls to any method or property of a BitmapData object fail if the BitmapData object is invalid (for example, if it has height == 0 and width == 0), and upon failing those properties and methods that return Number values return -1.
Availability: ActionScript 1.0; Flash Player 8
attachBitmap (MovieClip.attachBitmap method), beginBitmapFill (MovieClip.beginBitmapFill method)
|
Modifiers |
Property |
Description |
|---|---|---|
|
|
The height of the bitmap image in pixels. |
|
|
|
The rectangle that defines the size and location of the bitmap image. |
|
|
|
transparent |
Defines whether the bitmap image supports per-pixel transparency. |
|
|
The width of the bitmap image in pixels. |
Properties inherited from class Object constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)
|
Signature |
Description |
|---|---|
|
BitmapData |
Creates a BitmapData object with a specified width and height. |
|
Modifiers |
Signature |
Description |
|---|---|---|
|
|
applyFilter |
Takes a source image and a filter object and generates the filtered image. |
|
|
clone |
Returns a new BitmapData object that is a clone of the original instance with an exact copy of the contained bitmap. |
|
|
colorTransform |
Adjusts the color values in a specified area of a bitmap image by using a ColorTransform object. |
|
|
compare |
Compares two BitmapData objects. |
|
|
copyChannel |
Transfers data from one channel of another BitmapData object or the current BitmapData object into a channel of the current BitmapData object. |
|
|
copyPixels |
Provides a fast routine to perform pixel manipulation between images with no stretching, rotation, or color effects. |
|
|
dispose |
Frees memory that is used to store the BitmapData object. |
|
|
draw |
Draws a source image or movie clip onto a destination image, using the Flash Player vector renderer. |
|
|
Fills a rectangular area of pixels with a specified ARGB color. |
|
|
|
Performs a flood fill operation on an image starting at an (x, y) coordinate and filling with a certain color. |
|
|
|
generateFilterRect |
Determines the destination rectangle that the |
|
|
getColorBoundsRect |
Determines a rectangular region that fully encloses all pixels of a specified color within the bitmap image. |
|
|
Returns an integer that represents an RGB pixel value from a BitmapData object at a specific point (x, y). |
|
|
|
getPixel32 |
Returns an ARGB color value that contains alpha channel data and RGB data. |
|
|
hitTest |
Performs pixel-level hit detection between one bitmap image and a point, rectangle or other bitmap image. |
|
|
loadBitmap |
Returns a new BitmapData object that contains a bitmap image representation of the symbol that is identified by a specified linkage ID in the library. |
|
|
merge |
Performs per-channel blending from a source image to a destination image. |
|
|
noise |
Fills an image with pixels representing random noise. |
|
|
paletteMap |
Remaps the color channel values in an image that has up to four arrays of color palette data, one for each channel. |
|
|
perlinNoise |
Generates a Perlin noise image. |
|
|
pixelDissolve |
Performs a pixel dissolve either from a source image to a destination image or by using the same image. |
|
|
Scrolls an image by a certain (x, y) pixel amount. |
|
|
|
Sets the color of a single pixel of a BitmapData object. |
|
|
|
setPixel32 |
Sets the color and alpha transparency values of a single pixel of a BitmapData object. |
|
|
threshold |
Tests pixel values in an image against a specified threshold and sets pixels that pass the test to new color values. |
Methods inherited from class Object
Flash CS3
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00001393.html