User Guide
BitmapData (flash.display.BitmapData) 329
function sketch() {
myBitmapData.setPixel32(_xmouse, _ymouse, 0x00000000);
}
See also
getPixel32 (BitmapData.getPixel32 method), setPixel (BitmapData.setPixel
method)
threshold (BitmapData.threshold method)
public threshold(sourceBitmap:BitmapData, sourceRect:Rectangle,
destPoint:Point, operation:String, threshold:Number, [color:Number],
[mask:Number], [copySource:Boolean]) : Number
Tests pixel values in an image against a specified threshold and sets pixels that pass the test to
new color values. Using the
threshold() method, you can isolate and replace color ranges in
an image and perform other logical operations on image pixels.
The threshold test's logic is as follows:
if ((pixelValue & mask) operation (threshold & mask)) then
set pixel to color
else
if (copySource) then
set pixel to corresponding pixel value from sourceBitmap
The operation parameter specifies the comparison operator to use for the threshold test. For
example, by using "
==", you can isolate a specific color value in an image. Or by using
{operation: "<", mask: 0xFF000000, threshold: 0x7f000000, color:
0x00000000}
, you can set all destination pixels to be fully transparent when the source image
pixel's alpha is less than 0x7F. You can use this technique for animated transitions and other
effects.
Availability: ActionScript 1.0; Flash Player 8
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
instance.