User Guide
BitmapData (flash.display.BitmapData) 303
Example
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));
}
See also
ColorTransform (flash.geom.ColorTransform), Rectangle (flash.geom.Rectangle)
copyChannel (BitmapData.copyChannel method)
public copyChannel(sourceBitmap:BitmapData, sourceRect:Rectangle,
destPoint:Point, sourceChannel:Number, destChannel:Number) : Void
Transfers data from one channel of another BitmapData object or the current BitmapData
object into a channel of the current BitmapData object. All of the data in the other channels
in the destination BitmapData object are preserved.
The source channel value and destination channel value can be one of following values or a
sum of any of the values:
■ 1 (red)
■ 2 (green)
■ 4 (blue)
■ 8 (alpha)
Availability: ActionScript 1.0; Flash Player 8