YUI AS Component Documentation | All Packages | All Classes | Index | Frames No Frames |
Class JPGEncoder

Package | com.adobe.images
Class | public class JPGEncoder

Class that converts BitmapData into a valid JPEG

Public Methods

| Method | Defined by
--- | --- | ---
|  | JPGEncoder(quality:Number = 50) Constructor for JPEGEncoder class | JPGEncoder
|  | encode(image:BitmapData):ByteArray Created a JPEG image from the specified BitmapData | JPGEncoder

Constructor detail

JPGEncoder | () | constructor

`public function JPGEncoder(quality:Number = 50)`

Constructor for JPEGEncoder class

Parameters

| `quality:Number` (default = `50`)`` — The quality level between 1 and 100 that detrmines the level of compression used in the generated JPEG

Method detail

encode | () | method

`public function encode(image:BitmapData):ByteArray`

Created a JPEG image from the specified BitmapData

Parameters

| `image:BitmapData` — The BitmapData that will be converted into the JPEG format.

Returns

| `ByteArray` — a ByteArray representing the JPEG encoded image data.