320
ActionScript classes
var mc_1:MovieClip = this.createEmptyMovieClip("mc",
this.getNextHighestDepth());
mc_1.attachBitmap(bitmapData_1, this.getNextHighestDepth());
var mc_2:MovieClip = this.createEmptyMovieClip("mc",
this.getNextHighestDepth());
mc_2.attachBitmap(bitmapData_2, this.getNextHighestDepth());
mc_2._x = 101;
mc_1.onPress = function() {
bitmapData_1.merge(bitmapData_2, new Rectangle(0, 0, 50, 40), new
Point(25, 20), 128, 0, 0, 0);
}
mc_1.onPress = function() {
bitmapData_1.noise(128, 0, 255, 1, true);
}
mc_2.onPress = function() {
bitmapData_2.noise(128);
}
paletteMap (BitmapData.paletteMap method)
public paletteMap(sourceBitmap:BitmapData, sourceRect:Rectangle,
destPoint:Point, [redArray:Array], [greenArray:Array], [blueArray:Array],
[alphaArray:Array]) : Void
Remaps the color channel values in an image that has up to four arrays of color palette data,
one for each channel.
Flash Player uses the following formula to generate the resulting image.
After the red, green, blue, and alpha values are computed, they are added together using
standard 32-bit-integer arithmetic. The red, green, blue, and alpha channel values of each
pixel are is extracted into a separate 0 to 255 value. These values are used to look up new color
values in the appropriate array:
redArray
,
greenArray
,
blueArray
, and
alphaArray
. Each
of these four arrays should contain 256 values. After all four of the new channel values are
retrieved, they are combined into a standard ARGB value, which is applied to the pixel.
Cross-channel effects can be supported with this method. Each input array can contain full
32-bit values, and there is no shifting when the values are added together. This routine does
not support per-channel clamping.
If no array is specified for a channel, the color channel is simply copied from the source image
to the destination image.
Содержание FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Страница 1: ...ActionScript 2 0 Language Reference ...
Страница 1352: ...1352 ActionScript classes ...