egret.BitmapData
包 egret
类 public class BitmapData
继承 egret.BitmapData → egret.HashObject
BitmapData 对象是一个包含像素数据的数组。此数据可以表示完全不透明的位图,或表示包含 Alpha 通道数据的透明位图。以上任一类型的 BitmapData 对象都作为 32 位整数的缓冲区进行存储。每个 32 位整数确定位图中单个像素的属性。
每个 32 位整数都是四个 8 位通道值(从 0 到 255)的组合,这些值描述像素的 Alpha 透明度以及红色、绿色、蓝色 (ARGB) 值。(对于 ARGB 值,最高有效字节代表 Alpha 通道值,其后的有效字节分别代表红色、绿色和蓝色通道值。)
公共属性
| 属性 | 
|---|
| debugCompressedTextureURL : string | 
| etcAlphaMask : Nullable<egret.BitmapData> | 
| format : string   纹理格式  | 
| height : number   位图图像的高度,以像素为单位  | 
| source : any | 
| width : number   位图图像的宽度,以像素为单位  | 
公共方法
| 方法 | 
|---|
| BitmapData(source:any)   创建一个引用指定 source 实例的 BitmapData 对象  | 
| clearCompressedTextureData():void | 
| create(type:"arraybuffer"|"base64",data:ArrayBuffer|string,callback:(bitmapData:egret.BitmapData)=>void):egret.BitmapData   [静态]  | 
| getCompressed2dTextureData():egret.CompressedTextureData | 
| hasCompressed2d():boolean | 
属性详细信息
debugCompressedTextureURL
debugCompressedTextureURL : string = ''
- 支持版本:all
 - 运行平台:Web,Native
 
etcAlphaMask
etcAlphaMask : Nullable<egret.BitmapData> = null
- 支持版本:all
 - 运行平台:Web,Native
 
format
format : string = "image"
- 支持版本:Egret 2.4
 - 运行平台:Web,Native
 
纹理格式。
height
height : number
- 支持版本:Egret 2.4
 - 运行平台:Web,Native
 
位图图像的高度,以像素为单位。
source
source : any
- 支持版本:all
 - 运行平台:Web,Native
 
width
width : number
- 支持版本:Egret 2.4
 - 运行平台:Web,Native
 
位图图像的宽度,以像素为单位。
方法详细信息
BitmapData()
public BitmapData(source:any)
创建一个引用指定 source 实例的 BitmapData 对象
- 支持版本:Egret 2.4
 - 运行平台:Web,Native
 - 参数
- source:any - 被引用的 source 实例
 
 
clearCompressedTextureData()
public clearCompressedTextureData():void
- 支持版本:all
 - 运行平台:Web,Native
 
create()
public create(type:"arraybuffer"|"base64",data:ArrayBuffer|string,callback:(bitmapData:egret.BitmapData)=>void):egret.BitmapData
- 支持版本:all
 - 运行平台:Web,Native
 - 参数
- type:"arraybuffer"|"base64"
 - data:ArrayBuffer|string
 - callback:(bitmapData:egret.BitmapData)=>void
 
 
getCompressed2dTextureData()
public getCompressed2dTextureData():egret.CompressedTextureData
- 支持版本:all
 - 运行平台:Web,Native
 
hasCompressed2d()
public hasCompressed2d():boolean
- 支持版本:all
 - 运行平台:Web,Native
 

