Android的BitmapFactory的使用
来源:互联网 发布:列强瓜分中国知乎 编辑:程序博客网 时间:2024/05/20 09:10
使用BitmapFactory可以将读取流,文件,byte 数组转换成Bitmap对象
例如:Bitmap bitmap = BitmapFactory.decodeStream(inputStream);img_pic.setImageBitmap(bitmap);//为ImageView设置图片
API如下:
static Bitmap decodeByteArray(byte[] data, int offset, int length, BitmapFactory.Options opts)Decode an immutable bitmap from the specified byte array.static Bitmap decodeByteArray(byte[] data, int offset, int length)Decode an immutable bitmap from the specified byte array.static Bitmap decodeFile(String pathName)Decode a file path into a bitmap.static Bitmap decodeFile(String pathName, BitmapFactory.Options opts)Decode a file path into a bitmap.static Bitmap decodeFileDescriptor(FileDescriptor fd)Decode a bitmap from the file descriptor.static Bitmap decodeFileDescriptor(FileDescriptor fd, Rect outPadding, BitmapFactory.Options opts)Decode a bitmap from the file descriptor.static Bitmap decodeResource(Resources res, int id, BitmapFactory.Options opts)Synonym for opening the given resource and calling decodeResourceStream(Resources, TypedValue, InputStream, Rect, BitmapFactory.Options).static Bitmap decodeResource(Resources res, int id)Synonym for decodeResource(Resources, int, android.graphics.BitmapFactory.Options) will null Options.static Bitmap decodeResourceStream(Resources res, TypedValue value, InputStream is, Rect pad, BitmapFactory.Options opts)Decode a new Bitmap from an InputStream.static Bitmap decodeStream(InputStream is)Decode an input stream into a bitmap.static Bitmap decodeStream(InputStream is, Rect outPadding, BitmapFactory.Options opts)Decode an input stream into a bitmap.
阅读全文
1 0
- Android的BitmapFactory的使用
- Android 关于BitmapFactory 的使用
- android之BitmapFactory.Options的使用
- android之BitmapFactory.Options的使用
- android之BitmapFactory.Options的使用
- android之BitmapFactory.Options的使用
- android之BitmapFactory.Options的使用
- android的Bitmap和BitmapFactory类的使用
- android BitmapFactory的OutOfMemoryError 解决
- android BitmapFactory的内存溢出
- android BitmapFactory的OutOfMemoryError: bitmap ...
- 浅谈BitmapFactory.Options的使用
- BitmapFactory的使用获取Bitmap
- android之BitmapFactory.Options的使用,避免oom
- Android BitmapFactory的OutOfMemoryError问题,最近看到
- Android BitmapFactory支持解析的图片格式
- android中BitmapFactory.decodeByteArray的用法
- 图片压缩--BitmapFactory.Options的使用
- 在windows上运行python程序
- 51Nod-1519-拆方块
- Unsafe类compareAndSwapInt返回值
- SetWindowsHookEx
- BZOJ 2431: [HAOI2009]逆序对数列 dp
- Android的BitmapFactory的使用
- K-means算法原理 blog收集
- 浅谈C语言中常用函数
- 热修复框架Tinker最完整讲解(01)——集成之路
- LTE学习笔记-PHY-PHY层概述
- [leetcode]42. Trapping Rain Water
- Git新建分支出现fatal: Not a valid object name: 'master'错误
- 关于hadoop集群你需要知道的知识点
- C++深浅拷贝