EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - Colortransform (Bitmapdata.colortransform Method)

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
1378 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
302 ActionScript classes
// >> height: 80
// >> width: 100
}
To further demonstrate the relationships between bitmap_1, bitmap_2, and clonedBitmap
the following example modifies the pixel value at (1, 1) of
bitmap_1. Modifying pixel value at
(1, 1) demonstrates that the
clone() method creates an instance based on values of the
bitmap_1 instance instead instead of refering to the values.
import flash.display.BitmapData;
var bitmap_1:BitmapData = new BitmapData(100, 80, false, 0x000000);
var bitmap_2:BitmapData = bitmap_1;
var clonedBitmap:BitmapData = bitmap_1.clone();
trace(bitmap_1.getPixel32(1, 1)); // -16777216
trace(bitmap_2.getPixel32(1, 1)); // -16777216
trace(clonedBitmap.getPixel32(1, 1)); // -16777216
bitmap_1.setPixel32(1, 1, 0xFFFFFF);
trace(bitmap_1.getPixel32(1, 1)); // -1
trace(bitmap_2.getPixel32(1, 1)); // -1
trace(clonedBitmap.getPixel32(1, 1)); // -16777216
colorTransform (BitmapData.colorTransform
method)
public colorTransform(rect:Rectangle, colorTransform:ColorTransform) : Void
Adjusts the color values in a specified area of a bitmap image by using a ColorTransform
object. If the rectangle matches the boundaries of the bitmap image, this method transforms
the color values of the entire image.
Availability: ActionScript 1.0; Flash Player 8
Parameters
rect:flash.geom.Rectangle - A Rectangle object that defines the area of the image in
which the ColorTransform object is applied.
colorTransform:flash.geom.ColorTransform - A ColorTransform object that describes
the color transformation values to apply.

Table of Contents

Related product manuals