44
Objects
Example
The following code retrieves the width of the bitmap in pixels:
// Get the number of pixels in the horizontal dimension.
var bmObj = fl.getDocumentDOM().selection[0];
var isBitmap = bmObj.instanceType;
if(isBitmap == "bitmap"){
var numHorizontalPixels = bmObj.hPixels;
}
See also
bitmapInstance.vPixels
bitmapInstance.setBits()
Availability
Flash MX 2004.
Usage
bitmapInstance.setBits(
bitmap
)
Parameters
bitmap
An object that contains
height
,
width
,
depth
,
bits
, and
cTab
properties. The
height
,
width
, and
depth
properties
are integers. The
bits
property is a byte array. The
cTab
property is required only for bitmaps with a bit depth of 8 or less and is a string that
represents a color value in the form
"#RRGGBB"
.
Returns
Nothing.
Description
Method; sets the bits of an existing bitmap element. This lets you create bitmap effects by
getting the bits out of the bitmap, manipulating them, and then returning the bitmap to
Flash.
NO
T
E
The byte array is meaningful only when referenced by an external library. You typically
use it only when creating an extensible tool or effect.
Summary of Contents for FLASH 8-EXTENDING FLASH
Page 1: ...Extending Flash...
Page 38: ...38 Top Level Functions and Methods...
Page 532: ...532 Objects...
Page 554: ...554 C Level Extensibility...