套件 | mx.graphics.codec |
介面 | public interface IImageEncoder |
實作者 | JPEGEncoder, PNGEncoder |
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
相關 API 元素
公用屬性
屬性 | 定義自 | ||
---|---|---|---|
contentType : String [唯讀]
The MIME type for the image format that this encoder produces. | IImageEncoder |
公用方法
方法 | 定義自 | ||
---|---|---|---|
Encodes a BitmapData object as a ByteArray. | IImageEncoder | ||
Encodes a ByteArray object containing raw pixels
in 32-bit ARGB (Alpha, Red, Green, Blue) format
as a new ByteArray object containing encoded image data. | IImageEncoder |
屬性詳細資訊
contentType | 屬性 |
方法詳細資訊
encode | () | 方法 |
public function encode(bitmapData:BitmapData):ByteArray
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Encodes a BitmapData object as a ByteArray.
參數
bitmapData:BitmapData — The input BitmapData object.
|
ByteArray — Returns a ByteArray object containing 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 |
Encodes a ByteArray object containing raw pixels in 32-bit ARGB (Alpha, Red, Green, Blue) format as a new ByteArray object containing encoded image data. 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.
|
ByteArray — Returns a ByteArray object containing encoded image data.
|
Tue Jun 12 2018, 03:47 PM Z