Pacotemx.graphics.codec
Classepublic class PNGEncoder
HerançaPNGEncoder Inheritance Object
Implementa IImageEncoder

The PNGEncoder class converts raw bitmap images into encoded images using Portable Network Graphics (PNG) lossless compression.

For the PNG specification, see http://www.w3.org/TR/PNG/

.



Propriedades Públicas
 PropriedadeDefinido por
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  contentType : String
[read-only] The MIME type for the PNG encoded image.
PNGEncoder
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
Métodos Públicos
 MétodoDefinido por
  
Constructor.
PNGEncoder
  
Converts the pixels of a BitmapData object to a PNG-encoded ByteArray object.
PNGEncoder
  
encodeByteArray(byteArray:ByteArray, width:int, height:int, transparent:Boolean = true):ByteArray
Converts a ByteArray object containing raw pixels in 32-bit ARGB (Alpha, Red, Green, Blue) format to a new PNG-encoded ByteArray object.
PNGEncoder
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
Detalhes da propriedade
contentTypepropriedade
contentType:String  [read-only]

The MIME type for the PNG encoded image. The value is "image/png".


Implementação
    public function get contentType():String
Detalhes do construtor
PNGEncoder()Construtor
public function PNGEncoder()

Constructor.

Detalhes do método
encode()método
public function encode(bitmapData:BitmapData):ByteArray

Converts the pixels of a BitmapData object to a PNG-encoded ByteArray object.

Parâmetros

bitmapData:BitmapData — The input BitmapData object.

Retorna
ByteArray
encodeByteArray()método 
public function encodeByteArray(byteArray:ByteArray, width:int, height:int, transparent:Boolean = true):ByteArray

Converts a ByteArray object containing raw pixels in 32-bit ARGB (Alpha, Red, Green, Blue) format to a new PNG-encoded ByteArray object. The original ByteArray is left unchanged.

Parâmetros

byteArray:ByteArray — The input ByteArray object containing raw pixels. This ByteArray should contain 4 width height bytes. Each pixel is represented by 4 bytes, in the order ARGB. The first four bytes represent the top-left pixel of the image. The next four bytes represent the pixel to its right, etc. Each row follows the previous one without any padding.
 
width:int — The width of the input image, in pixels.
 
height:int — The height of the input image, in pixels.
 
transparent:Boolean (default = true) — If false, alpha channel information is ignored but you still must represent each pixel as four bytes in ARGB format.

Retorna
ByteArray