var mc:MovieClip = this.createEmptyMovieClip("mc",
this.getNextHighestDepth());
mc.attachBitmap(myBitmapData, this.getNextHighestDepth());
merge (BitmapData.merge method)
public merge(sourceBitmap:BitmapData, sourceRect:Rectangle,
destPoint:Point, redMult:Number, greenMult:Number, blueMult:Number,
alphaMult:Number) : Void
Performs per-channel blending from a source image to a destination image. The following
formula is used for each channel:
new red dest = (red source * redMult) + (red dest * (256 - redMult) / 256;
The
,
redMult
greenMult
color channel. Their valid range is from 0 to 256.
Availability: ActionScript 1.0; Flash Player 8
Parameters
sourceBitmap:flash.display.BitmapData
image can be a different BitmapData object, or it can refer to the current BitmapData object.
sourceRect:flash.geom.Rectangle
to use as input.
destPoint:flash.geom.Point
BitmapData instance) that corresponds to the upper-left corner of the source rectangle.
- A number by which to multiply the red channel value.
redMult:Number
- A number by which to multiply the green channel value.
greenMult:Number
- A number by which to multiply the blue channel value.
blueMult:Number
- A number by which to multiply the alpha transparency value.
alphaMult:Number
Example
The following example shows how to merge part of one
import flash.display.BitmapData;
import flash.geom.Rectangle;
import flash.geom.Point;
var bitmapData_1:BitmapData = new BitmapData(100, 80, false, 0x00CCCCCC);
var bitmapData_2:BitmapData = new BitmapData(100, 80, false, 0x00FF0000);
var mc_1:MovieClip = this.createEmptyMovieClip("mc",
this.getNextHighestDepth());
mc_1.attachBitmap(bitmapData_1, this.getNextHighestDepth());
318
ActionScript classes
,
, and
blueMult
alphaMult
- A rectangle that defines the area of the source image
- The point within the destination image (the current
values are the multipliers used for each
- The input bitmap image to use. The source
BitmapData
with another.
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?