304
ActionScript classes
Parameters
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.
Example
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);
}
See also
Rectangle (flash.geom.Rectangle)
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...