Packagecom.adobe.bridge
Classpublic class BitmapData
InheritanceBitmapData Inheritance CSHostObject Inheritance flash.utils.Proxy

Since : CS5

Pixels are described by four channels: red, green, blue, and an "alpha" channel that represents the opacity of the pixel. Each channel stores a number between 0 and 255. For the color channels, 0 means an absence of that color and 255 means the maximum amount of that color. For the alpha channel, 0 means the pixel is completely transparent and 255 means it is completely opaque.This object allows direct manipulation of the pixels in memory. They are assumed to be stored in row-major order, with consecutive bytes for red, green, blue, and alpha channel. Each row may have some padding at the end, and the total width of a row, in bytes, is represented by rowBytes. The maximum width and maximum height of a BitmapData object is 8192 pixels.Create the object using the new operator: There are three forms of the constructor:new BitmapData (width, height, transparent fillColornew BitmapData (file[, preserveColorProfile])new BitmapData (width, height, transparent, rowBytes, data)Parameters set corresponding properties, or specify the source data, directly or indirectly. Specify true for preserveColorProfile to preserve the embedded color profile, if any. If none is present, or if not supplied, embeds the default sRGB profile. Note that ACR cannot be used with a preserved embedded profile; it returns all images with an sRGB profile which would conflict with the desired color profile behavior. If you choose to preserve the embedded profile, the standard JPEG or TIFF libraries are used, even if the thumbnail preference "Use ACR for JPEG and TIFF" is set.



Public Properties
 PropertyDefined By
  channelCount : Number
[read-only]
BitmapData
  checksum : Number
[read-only] A 32-bit Adler checksum of the image data.
BitmapData
  colorSpace : Number
[read-only]
BitmapData
  height : Number
[read-only] Image height in pixels.
BitmapData
 InheritedhostObjectDelegate : HostObject
Getter for the delegate
CSHostObject
  pointer : Number
[read-only] A pointer to the buffer storing the matrix of pixels.
BitmapData
  rectangle : Array
[read-only] The rectangle that defines the size of the bitmap image, in the format [0, 0, w, h].
BitmapData
  rowBytes : Number
[read-only] The length in bytes of a row of pixels.
BitmapData
  transparent : Boolean
[read-only] True if the bitmap image supports per-pixel transparency.
BitmapData
  width : Number
[read-only] Image width in pixels.
BitmapData
Public Methods
 MethodDefined By
  
BitmapData(file:File = null, preserveColorProfile:Boolean = false)
BitmapData
  
clone():Object
Duplicates this object, creating a new object with an exact copy of the contained bitmap.
BitmapData
  
dispose():void
Explicitly frees the memory used to store pixel data for this object.
BitmapData
  
exportTo(dest:File, options:Number):void
Writes the image data to a file in JPEG format.
BitmapData
 Inherited
filterArgsForHBAPI(args:Array):Array
[static] Function to clean up the argument list and put it into a format that makes sense for HBAPI.
CSHostObject
 Inherited
filterSingleObjectForHBAPI(value:Object):Object
[static]
CSHostObject
 Inherited
getClassObjectForName(className:String):HostObject
[static] This returns a "Class" object, meaning, a HostObject that can be used to make static function calls or get static properties
CSHostObject
  
getPixel(x:Number, y:Number):Number
Retrieves the color data for a specific pixel from the image.
BitmapData
  
getPixel32(x:Number, y:Number):Number
Retrieves the color data for a specific pixel from the image, including its alpha channel.
BitmapData
 Inherited
getSpecialTranslation(className:String, ho:HostObject, expectedReturnType:Class, ownerName:String):*
[static]
CSHostObject
 Inherited
hostCall(name:String, expectedReturnType:Class, rawargs:Array):*
Encapsulates a function call to the host
CSHostObject
 Inherited
hostCallStatic(className:String, methodName:String, expectedReturnType:Class, rawargs:Array):*
[static] Implements a safe call of a static method on the host
CSHostObject
 Inherited
hostGet(name:String, expectedReturnType:Class):*
Encapsulates a property get to the host
CSHostObject
 Inherited
hostGetIndex(idx:Object, expectedReturnType:Class):*
Encapsulates a indexed get to the host
CSHostObject
 Inherited
hostGetStatic(className:String, propertyName:String, expectedReturnType:Class):*
[static] Implements a safe get of a static property on the host Used by for instance, all the enum implementations.
CSHostObject
 Inherited
hostSet(name:String, rawvalue:*):void
Encapsulates a property set to the host
CSHostObject
 Inherited
hostSetStatic(className:String, propertyName:String, rawvalue:*):*
[static] Implements a safe set of a static property on the host
CSHostObject
 Inherited
isDescendedFrom(clz:Class, ancClass:Class):Boolean
[static] Efficiently determines whether or not one class descends from another in inheritance hierarchy- class relationships are cached by the ClassUtils implementation- (uses org.as3commons lib to quickly discover class hierarchy.
CSHostObject
  
loadFromJpegStream(data:Number, dataSize:Number):void
Loads the JPEG stream at a memory address into this object, replacing the previous content.
BitmapData
  
loadFromPngStream(data:Number, dataSize:Number):void
Loads the PNG stream at a memory address into this object, replacing the previous content.
BitmapData
 Inherited
replaceDefaultArgs(args:Array, defaultArgs:Array):Array
Function to tidy up arguments prior to call.
CSHostObject
  
resize(dimension:Number, resizeQuality:String):void
Resizes the bitmap to the specified dimensions.
BitmapData
  
rotate(angleInDegrees:Number):Object
Rotates the bitmap by the specified multiple of 90 degrees.
BitmapData
  
setPixel(x:Number, y:Number, color:Object):void
Sets the color data for a specific pixel from the image.
BitmapData
  
setPixel32(x:Number, y:Number, color:Object):void
Sets the color data for a specific pixel from the image, including its alpha channel.
BitmapData
 Inherited
wrapReturnedHostObject(rawObject:Object, expectedReturnType:Class, client:CSHostObject, propertyName:String):*
[static] Method used on static/normal get/ hostcalls
CSHostObject
Protected Methods
 MethodDefined By
  
createWithArgs(args:Array):void
[override]
BitmapData
 Inherited
hostCreate(args:Array):void
CSHostObject
Property Detail
channelCountproperty
channelCount:Number  [read-only]

Since : CS5


Implementation
    public function get channelCount():Number
checksumproperty 
checksum:Number  [read-only]

Since : CS5

A 32-bit Adler checksum of the image data.


Implementation
    public function get checksum():Number
colorSpaceproperty 
colorSpace:Number  [read-only]

Since : CS5


Implementation
    public function get colorSpace():Number
heightproperty 
height:Number  [read-only]

Since : CS5

Image height in pixels.


Implementation
    public function get height():Number
pointerproperty 
pointer:Number  [read-only]

Since : CS5

A pointer to the buffer storing the matrix of pixels.


Implementation
    public function get pointer():Number
rectangleproperty 
rectangle:Array  [read-only]

Since : CS5

The rectangle that defines the size of the bitmap image, in the format [0, 0, w, h]. Origin is top left.


Implementation
    public function get rectangle():Array
rowBytesproperty 
rowBytes:Number  [read-only]

Since : CS5

The length in bytes of a row of pixels.


Implementation
    public function get rowBytes():Number
transparentproperty 
transparent:Boolean  [read-only]

Since : CS5

True if the bitmap image supports per-pixel transparency.


Implementation
    public function get transparent():Boolean
widthproperty 
width:Number  [read-only]

Since : CS5

Image width in pixels.


Implementation
    public function get width():Number
Constructor Detail
BitmapData()Constructor
public function BitmapData(file:File = null, preserveColorProfile:Boolean = false)

Since : CS5

Parameters
file:File (default = null) — (File)
 
preserveColorProfile:Boolean (default = false) — (Boolean)
Method Detail
clone()method
public function clone():Object

Since : CS5

Duplicates this object, creating a new object with an exact copy of the contained bitmap.

Returns
Object
createWithArgs()method 
override protected function createWithArgs(args:Array):void

Since : CS5

Parameters

args:Array

dispose()method 
public function dispose():void

Since : CS5

Explicitly frees the memory used to store pixel data for this object.

exportTo()method 
public function exportTo(dest:File, options:Number):void

Since : CS5

Writes the image data to a file in JPEG format.

Parameters

dest:File — (File)
 
options:Number — (Number)

getPixel()method 
public function getPixel(x:Number, y:Number):Number

Since : CS5

Retrieves the color data for a specific pixel from the image.

Parameters

x:Number — (Number)
 
y:Number — (Number)

Returns
Number
getPixel32()method 
public function getPixel32(x:Number, y:Number):Number

Since : CS5

Retrieves the color data for a specific pixel from the image, including its alpha channel.

Parameters

x:Number — (Number)
 
y:Number — (Number)

Returns
Number
loadFromJpegStream()method 
public function loadFromJpegStream(data:Number, dataSize:Number):void

Since : CS5

Loads the JPEG stream at a memory address into this object, replacing the previous content.

Parameters

data:Number — (Number)
 
dataSize:Number — ( Number)

loadFromPngStream()method 
public function loadFromPngStream(data:Number, dataSize:Number):void

Since : CS5

Loads the PNG stream at a memory address into this object, replacing the previous content.

Parameters

data:Number — (Number)
 
dataSize:Number — ( Number)

resize()method 
public function resize(dimension:Number, resizeQuality:String):void

Since : CS5

Resizes the bitmap to the specified dimensions.

Parameters

dimension:Number — (Number)
 
resizeQuality:String — (String)

rotate()method 
public function rotate(angleInDegrees:Number):Object

Since : CS5

Rotates the bitmap by the specified multiple of 90 degrees.

Parameters

angleInDegrees:Number — (Number)

Returns
Object
setPixel()method 
public function setPixel(x:Number, y:Number, color:Object):void

Since : CS5

Sets the color data for a specific pixel from the image.

Parameters

x:Number — (Number)
 
y:Number — (Number)
 
color:Object — (Object)

setPixel32()method 
public function setPixel32(x:Number, y:Number, color:Object):void

Since : CS5

Sets the color data for a specific pixel from the image, including its alpha channel.

Parameters

x:Number — (Number)
 
y:Number — (Number)
 
color:Object — (Object)