-
Notifications
You must be signed in to change notification settings - Fork 26
PNGEncoder
Nick Ryzhy edited this page Apr 4, 2016
·
11 revisions
Encodes image data using PNG compression algorithm. This class may use different compression techniques provided in PNG8Encoder and PNG24Encoder.
Name | Value |
---|---|
Package | by.blooddy.crypto.image |
Name | class PNGEncoder |
Inheritance |
PNGEncoder → Process → EventDispatcher → Object
|
Subclasses | PNG24Encoder, PNG8Encoder |
import by.blooddy.crypto.PNGEncoder;
var result:ByteArray = PNGEncoder.encode( bytes, 100, 100, PNGFilter.NONE );
import by.blooddy.crypto.PNGEncoder;
import by.blooddy.crypto.PNGFilter;
import by.blooddy.crypto.events.ProcessEvent;
var png:PNGEncoder = new PNGEncoder();
png.encode( bytes, 100, 100, PNGFilter.NONE );
png.addEventListener( ProcessEvent.COMPLETE, function(event:ProcessEvent):void {
var result:ByteArray = event.data;
trace( result ); // async result
} );
png.addEventListener( ProcessEvent.ERROR, function(event:ProcessEvent):void {
var error:Error = event.data;
trace( error ); // async error
} );
Name | Description |
---|---|
encode(image:BitmapData, filter:uint=0):ByteArray |
Creates a PNG-encoded byte sequence from the specified BitmapData . Used BitmapData.encode() , if posible. |
encodeBytes(bytes:ByteArray, width:uint, height:uint, filter:uint=0):ByteArray |
Creates a PNG-encoded byte sequence from the specified ByteArray . |
Name | Description |
---|---|
PNGEncoder() |
Creates a PNGEncoder object. |
Name | Description |
---|---|
encode(image:BitmapData, filter:uint=0):ByteArray |
Asynchronously creates a PNG-encoded byte sequence from the specified BitmapData . Dispatched sequence of bytes in ProcessEvent . |
encodeBytes(bytes:ByteArray, width:uint, height:uint, filter:uint=0):ByteArray |
Asynchronously creates a PNG-encoded byte sequence from the specified ByteArray . Dispatched sequence of bytes in ProcessEvent . |
Name | Type | Description |
---|---|---|
complete |
ProcessEvent | Dispatched when success. |
error |
ProcessEvent | Dispatched when fault. |