03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

See also<br />

Rectangle (flash.geom.Rectangle)<br />

copyPixels (BitmapData.copyPixels method)<br />

public copyPixels(sourceBitmap:BitmapData, sourceRect:Rectangle,<br />

destPoint:Point, [alphaBitmap:BitmapData], [alphaPoint:Point],<br />

[mergeAlpha:Boolean]) : Void<br />

Provides a fast routine to perform pixel manipulation between images with no stretching,<br />

rotation, or color effects. This method copies a rectangular area of a source image to a<br />

rectangular area of the same size at the destination point of the destination BitmapData<br />

object.<br />

If include the alphaBitmap <strong>and</strong> alphaPoint parameters, you can use a secondary image as an<br />

alpha source for the source image. If the source image has alpha data, both sets of alpha data<br />

are used to composite pixels from the source image to the destination image. The alphaPoint<br />

parameter is the point in the alpha image that corresponds to the upper-left corner of the<br />

source rectangle. Any pixels outside the intersection of the source image <strong>and</strong> alpha image are<br />

not copied to the destination image.<br />

The mergeAlpha property controls whether or not the alpha channel is used when a<br />

transparent image is copied onto another transparent image. To simply copy pixels (with no<br />

alpha used), set the mergeAlpha property to false. Then all pixels are copied from source to<br />

destination. By default, the mergeAlpha property is false.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 8<br />

Parameters<br />

sourceBitmap:BitmapData - The input bitmap image from which to copy pixels. The<br />

source image can be a different BitmapData instance, or it can refer to the current<br />

BitmapData instance.<br />

sourceRect:Rectangle - A rectangle that defines the area of the source image to use as<br />

input.<br />

destPoint:Point - The destination point, that represents the upper-left corner of the<br />

rectangular area where the new pixels are placed.<br />

alphaBitmap:BitmapData [optional] - A secondary, alpha BitmapData object source.<br />

alphaPoint:Point [optional] - The point in the alpha BitmapData object source that<br />

corresponds to the upper-left corner of the sourceRect parameter.<br />

mergeAlpha:Boolean [optional] - A Boolean value:To use the alpha channel, set the value to<br />

true. To copy pixels with no alpha channel, set the value to false.<br />

BitmapData (flash.display.BitmapData) 313

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!