| 包 | mx.graphics.codec | 
| 类 | public class PNGEncoder | 
| 继承 | PNGEncoder    Object | 
| 实现 | IImageEncoder | 
有关 PNG 规范,请参见 http://www.w3.org/TR/PNG/
.| 属性 | 定义方 | ||
|---|---|---|---|
![]()  | constructor : Object 
  对类对象或给定对象实例的构造函数的引用。  | Object | |
| contentType : String [只读 (read-only)] PNG 编码的图像的 MIME 类型。  | PNGEncoder | ||
![]()  | prototype : Object [静态] 
  对类或函数对象的原型对象的引用。  | Object | |
| 方法 | 定义方 | ||
|---|---|---|---|
构造函数。  | PNGEncoder | ||
将 BitmapData 对象的像素转换为 PNG 编码的 ByteArray 对象。  | PNGEncoder | ||
将包含 32 位 ARGB(Alpha、红、绿、蓝)格式原始像素的 ByteArray 对象转换为新的 PNG 编码的 ByteArray 对象。  | PNGEncoder | ||
![]()  | 
  指示对象是否已经定义了指定的属性。  | Object | |
![]()  | 
  指示 Object 类的实例是否在指定为参数的对象的原型链中。  | Object | |
![]()  | 
  指示指定的属性是否存在、是否可枚举。  | Object | |
![]()  | 
     设置循环操作动态属性的可用性。  | Object | |
![]()  | 
  返回指定对象的字符串表示形式。  | Object | |
![]()  | 
  返回指定对象的原始值。  | Object | |
| contentType | 属性 | 
contentType:String  [只读 (read-only)] 
          PNG 编码的图像的 MIME 类型。此值为 "image/png"。
        
    public function get contentType():String| PNGEncoder | () | 构造函数 | 
public function PNGEncoder()构造函数。
| encode | () | 方法 | 
 public function encode(bitmapData:BitmapData):ByteArray将 BitmapData 对象的像素转换为 PNG 编码的 ByteArray 对象。
参数
bitmapData:BitmapData — BitmapData 输入对象。 | 
ByteArray — 返回包含以 PNG 格式编码的图像数据的 ByteArray 对象。 | 
| encodeByteArray | () | 方法 | 
 public function encodeByteArray(byteArray:ByteArray, width:int, height:int, transparent:Boolean = true):ByteArray将包含 32 位 ARGB(Alpha、红、绿、蓝)格式原始像素的 ByteArray 对象转换为新的 PNG 编码的 ByteArray 对象。原始的 ByteArray 将保持不变。
参数
byteArray:ByteArray — 
              包含原始像素的 ByteArray 输入对象。此 ByteArray 应包含 4 width height 字节。每个像素都由 4 个字节表示,顺序依次为 ARGB。前四个字节表示图像左上角的像素。接下来的四个字节表示其右侧的像素,依此类推。每一行与前一行之间没有任何填充。
             | |
width:int — 输入图像的宽度(以像素为单位)。 | |
height:int — 输入图像的高度(以像素为单位)。 | |
transparent:Boolean (default = true) — 
              如果为 false,则将忽略 Alpha 通道信息,但是您仍必须使用 ARGB 格式以四个字节表示每个像素。
             | 
ByteArray — 返回包含以 PNG 格式编码的图像数据的 ByteArray 对象。 |