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)
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:
(red)
1
(green)
2
(blue)
4
(alpha)
8
Availability: ActionScript 1.0; Flash Player 8
,
Rectangle (flash.geom.Rectangle)
BitmapData (flash.display.BitmapData)
303
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?