套件 | mx.graphics.codec |
類別 | public class JPEGEncoder |
繼承 | JPEGEncoder Object |
實作 | IImageEncoder |
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
公用屬性
屬性 | 定義自 | ||
---|---|---|---|
constructor : Object
類別物件的參照或是特定物件實體的建構函數。 | Object | ||
contentType : String [唯讀]
The MIME type for the JPEG encoded image. | JPEGEncoder |
公用方法
方法 | 定義自 | ||
---|---|---|---|
JPEGEncoder(quality:Number = 50.0)
Constructor. | JPEGEncoder | ||
Converts the pixels of BitmapData object
to a JPEG-encoded ByteArray object. | JPEGEncoder | ||
Converts a ByteArray object containing raw pixels
in 32-bit ARGB (Alpha, Red, Green, Blue) format
to a new JPEG-encoded ByteArray object. | JPEGEncoder | ||
指出物件是否有已定義的指定屬性。 | Object | ||
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。 | Object | ||
指出指定的屬性是否存在,以及是否可列舉。 | Object | ||
為迴圈作業設定動態屬性的可用性。 | Object | ||
傳回代表此物件的字串,根據地區特定慣例進行格式化。 | Object | ||
會傳回指定之物件的字串形式。 | Object | ||
會傳回指定之物件的基本值。 | Object |
屬性詳細資訊
contentType | 屬性 |
建構函式詳細資料
JPEGEncoder | () | 建構函式 |
public function JPEGEncoder(quality:Number = 50.0)
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Constructor.
參數quality:Number (default = 50.0 ) — A value between 0.0 and 100.0.
The smaller the quality value,
the smaller the file size of the resultant image.
The value does not affect the encoding speed.
Note that even though this value is a number between 0.0 and 100.0,
it does not represent a percentage.
The default value is 50.0.
|
方法詳細資訊
encode | () | 方法 |
public function encode(bitmapData:BitmapData):ByteArray
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Converts the pixels of BitmapData object to a JPEG-encoded ByteArray object.
參數
bitmapData:BitmapData — The input BitmapData object.
|
ByteArray — Returns a ByteArray object containing JPEG-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 JPEG-encoded ByteArray object. The original ByteArray is left unchanged. Transparency is not supported; however you still must represent each pixel as four bytes in ARGB format.
參數
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 JPEG-encoded image data.
|
Tue Jun 12 2018, 03:47 PM Z