Flash CS3 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript classes > BitmapData (flash.display.BitmapData) > 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
rect:Rectangle - A Rectangle object that defines the area of the image in which the ColorTransform object is applied.
colorTransform:ColorTransform - A ColorTransform object that describes the color transformation values to apply.
The following example shows how to apply a color transform operation to a BitmapData instance.
import flash.display.BitmapData;
import flash.geom.ColorTransform;
var myBitmapData:BitmapData = new BitmapData(100, 80, false, 0x00CCCCCC);
var mc:MovieClip = this.createEmptyMovieClip("mc", this.getNextHighestDepth());
mc.attachBitmap(myBitmapData, this.getNextHighestDepth());
mc.onPress = function() {
myBitmapData.colorTransform(myBitmapData.rectangle, new ColorTransform(1, 0, 0, 1, 255, 0, 0, 0));
}
ColorTransform (flash.geom.ColorTransform), Rectangle (flash.geom.Rectangle)
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/00001397.html