套件 | mx.graphics.codec |
類別 | public class PNGEncoder |
繼承 | PNGEncoder Object |
實作 | IImageEncoder |
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
For the PNG specification, see http://www.w3.org/TR/PNG/
.公用屬性
屬性 | 定義自 | ||
---|---|---|---|
constructor : Object
類別物件的參照或是特定物件實體的建構函數。 | Object | ||
contentType : String [唯讀]
The MIME type for the PNG encoded image. | PNGEncoder |
公用方法
方法 | 定義自 | ||
---|---|---|---|
Constructor. | PNGEncoder | ||
Converts the pixels of a BitmapData object
to a PNG-encoded ByteArray object. | PNGEncoder | ||
Converts a ByteArray object containing raw pixels
in 32-bit ARGB (Alpha, Red, Green, Blue) format
to a new PNG-encoded ByteArray object. | PNGEncoder | ||
指出物件是否有已定義的指定屬性。 | Object | ||
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。 | Object | ||
指出指定的屬性是否存在,以及是否可列舉。 | Object | ||
為迴圈作業設定動態屬性的可用性。 | Object | ||
傳回代表此物件的字串,根據地區特定慣例進行格式化。 | Object | ||
會傳回指定之物件的字串形式。 | Object | ||
會傳回指定之物件的基本值。 | Object |
屬性詳細資訊
contentType | 屬性 |
建構函式詳細資料
PNGEncoder | () | 建構函式 |
public function PNGEncoder()
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Constructor.
方法詳細資訊
encode | () | 方法 |
public function encode(bitmapData:BitmapData):ByteArray
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Converts the pixels of a BitmapData object to a PNG-encoded ByteArray object.
參數
bitmapData:BitmapData — The input BitmapData object.
|
ByteArray — Returns a ByteArray object containing PNG-encoded image data.
|
encodeByteArray | () | 方法 |
public function encodeByteArray(byteArray:ByteArray, width:int, height:int, transparent:Boolean = true):ByteArray
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
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.
參數
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.
|
ByteArray — Returns a ByteArray object containing PNG-encoded image data.
|
Tue Jun 12 2018, 03:47 PM Z