Flash 8 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript classes > BitmapData (flash.display.BitmapData) > 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 the following values or the sum of any of the values:
1 (red)2 (green)4 (blue)8 (alpha)Availability: ActionScript 1.0; Flash Player 8
sourceBitmap:flash.display.BitmapData - The input bitmap image to use. The source image can be a different BitmapData object or it can refer to the current BitmapData object.
sourceRect:flash.geom.Rectangle - The source Rectangle object. If you only want to copy channel data from a smaller area within the bitmap, specify a source rectangle that is smaller than the overall size of the BitmapData object.
destPoint:flash.geom.Point - The destination Point object that represents the upper-left corner of the rectangular area where the new channel data is placed. If you want to copy channel data from one area to a different area in the destination image, specify a point other than (0,0).
sourceChannel:Number - The source channel. Use a value from the set (1,2,4,8), which represent red, green, blue, and alpha channels, respectively, or a sum of any of the values.
destChannel:Number - The destination channel. Use a value from the set (1,2,4,8), which represent red, green, blue, and alpha channels, respectively, or a sum of any of the values.
The following example shows how to copy a source ARGB channel from a BitmapData object back onto itself at a different location:
import flash.display.BitmapData;
import flash.geom.Rectangle;
import flash.geom.Point;
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.copyChannel(myBitmapData, new Rectangle(0, 0, 50, 80), new Point(51, 0), 3, 1);
}
Rectangle (flash.geom.Rectangle)
Version 8
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/8/main/00001947.html
Comments
No screen name said on Apr 18, 2006 at 10:23 PM : No screen name said on Aug 8, 2006 at 7:53 PM :