网站中信息更新怎么做的,触摸屏网站开发,推广计划书怎么写,比较好的网站开发项目一张位图所占用的内存#xff1a;图片长度#xff08;px) x 图片宽度#xff08;px#xff09;x 一个像素点所占的字节数
在Android中#xff0c;存储一个像素点所占用的字节数是使用枚举类型Bitmap.Config中的各个参数来表示的参数如下#xff1a;
ALPHA_8#xff1a…一张位图所占用的内存图片长度px) x 图片宽度pxx 一个像素点所占的字节数
在Android中存储一个像素点所占用的字节数是使用枚举类型Bitmap.Config中的各个参数来表示的参数如下
ALPHA_8表示8位Alpha位图即A8,不存储其他颜色一个像素点占用1字节只有透明度没有颜色 ARGB_4444表示16位ARGB图A、R、G、B各占用4位一个像素点占444416位2字节 ARGB_8888表示32位ARGB图A、R、G、B各占用8位一个像素点占888832位4字节 RGB_565表示16位RGB位图即R占5位G占6位B占5位没有透明度
BitmapFactory BitmapFactory用于从各种资源文件数据流和字节数组中创建Bitmap对象BitmapFactory是一个工具类提供了大量的函数可以用于从不同的数据源中解析、创建Bitmap对象
从资源中解码一张位图主要以R.drawable.xxx的形式从本地资源中加载
public static Bitmap decodeResource(Resource res, int id);
public static Bitmap decodeResource(Resource res, int id, Options opts)文件中读取 pathName解码文件的全路径名必须是路径全名
public static Bitmap decodeFile(String pathName);
public static Bitmap decodeFile(String pathName, Options opts);数组中读取
public static Bitmap decodeByteArray(byte[] data, int offset, int length);
public static Bitmap decodeByteArray(byte[] data, int offset, int length, Options opts);
public static Bitmap decodeFileDescriptor(FileDescriptor fd);
public static Bitmap decodeFileDescriptor(FileDescriptor fd, Rect outPadding, Options opts);从输入流中读取
public static Bitmap decodeStream(InputStream is);
public static Bitmap decodeStream(InputStream is, Rect outPadding, Options opts);
public static Bitmap decodeResourceStream(Resources res, TypeValue value, InputStream is, Rect padding, Options opts);