BitmapFactory中常用的几个静态方法
来源:互联网 发布:软件系统维护合同 编辑:程序博客网 时间:2024/05/29 15:02
最近经常用到 BitmapFactory 中的静态方法来解析位图。做个整理,方便以后查阅。
参考资料:
- 官方文档
根据官方文档的解释,BitmapFactory 用于通过多种来源创建 Bitmap 对象,包括 files,streams,byte-arrays等。
几个重要的静态方法
注意,以下几个方法都为静态的,且返回值都是 Bitmap。即修饰符为 static Bitmap
。
decodeByteArray()
从指定的字节数组解析位图。
它的重载方法如下:
decodeByteArray(byte[] data, int offset, int length, BitmapFactory.Options opts)decodeByteArray(byte[] data, int offset, int length)
decodeFile()
从指定的文件路径解析位图。
它的重载方法如下:
decodeFile(String pathName, BitmapFactory.Options opts)decodeFile(String pathName)
decodeFileDescriptor()
从指定的文件描述符解析位图。
它的重载方法如下:
decodeFileDescriptor(FileDescriptor fd)decodeFileDescriptor(FileDescriptor fd, Rect outPadding, BitmapFactory.Options opts)
decodeStream()
从指定的输入流解析位图。
它的重载方法如下:
decodeStream(InputStream is)decodeStream(InputStream is, Rect outPadding, BitmapFactory.Options opts)
0 0
- BitmapFactory中常用的几个静态方法
- BitmapFactory.Options常用的几个参数
- Android中一些常用类的常用方法(Math、Random、Color、Paint、Canvas、Bitmap、BitmapFactory)
- JSP 中 request的几个常用方法
- MongoDB中Query的几个常用方法
- Android中常用的几个工具方法
- UIApplicationDelegate中常用的几个方法
- UIApplicationDelegate中常用的几个方法
- java多线程中几个常用的方法
- String中几个常用的方法
- Android——Bitmap及其BitmapFactory的常用方法
- 几个常用的方法
- JSP中与路径相关的常用的几个方法
- JSP中与路径相关的常用的几个方法
- JSP中与路径相关的常用的几个方法
- JSP中与路径相关的常用的几个方法
- 查询XML内容中节点的几个常用方法
- 推荐几个WEB中常用的工具方法
- OD调试之总结
- CCF之俄罗斯方块(java)
- 新JEP将简化Java类型变异
- 架构师米洛:你不经意的职场坏姿势会损坏你的身体
- 7、SQL Server:sql server 获取每一个类别中值最大的一条数据
- BitmapFactory中常用的几个静态方法
- 蓝桥杯算法提高 最大乘积
- 目前我使用的build.gradle
- BZOJ 3262: 陌上花开 (CDQ分治)
- SnackBar的使用
- enumerations inherit Enum
- Node.js Module -moudule.exports vs exports
- Android 自定义View(二)
- oj2470: 魔法矩阵