-
Notifications
You must be signed in to change notification settings - Fork 26
PNG8Encoder
Nick Ryzhy edited this page Apr 4, 2016
·
5 revisions
Encodes image data using PNG-8 compression algorithm.
Name | Value |
---|---|
Package | by.blooddy.crypto.image |
Name | final class PNG8Encoder |
Inheritance |
PNG8Encoder → PNGEncoder → Process → EventDispatcher → Object
|
import by.blooddy.crypto.PNG8Encoder;
var result:ByteArray = PNG8Encoder.encode( bytes, 100, 100, PNGFilter.NONE );
import by.blooddy.crypto.PNG8Encoder;
import by.blooddy.crypto.events.ProcessEvent;
var PNG8Encoder = new PNG8Encoder();
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, palette:IPalette=null):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, palette:IPalette=null):ByteArray |
Creates a PNG-encoded byte sequence from the specified ByteArray . |
Name | Description |
---|---|
PNG8Encoder() |
Creates a PNG8Encoder 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. |