Drawable和Bitmap的区别
来源:互联网 发布:excel数据库 编辑:程序博客网 时间:2024/05/17 02:40
Bitmap - 称作位图,一般位图的文件格式后缀为bmp,当然编码器也有很多如RGB565、RGB888。作为一种逐像素的显示对象执行效率高,但是缺点也很明显存储效率低。我们理解为一种存储对象比较好。
Drawable - 作为Android平下通用的图形对象,它可以装载常用格式的图像,比如GIF、PNG、JPG,当然也支持BMP,当然还提供一些高级的可视化对象,比如渐变、图形等。
A bitmap is a Drawable. A Drawable is not necessarily a bitmap. Like all thumbs are fingers but not all fingers are thumbs.
Bitmap是Drawable . Drawable不一定是Bitmap .就像拇指是指头,但不是所有的指头都是拇指一样.
The API dictates: API规定:
Though usually not visible to the application, Drawables may take a variety of forms: 尽管通常情况下对于应用是不可见的,Drawables 可以采取很多形式:
Bitmap: the simplest Drawable, a PNG or JPEG image. Bitmap: 简单化的Drawable, PNG 或JPEG图像.
Nine Patch: an extension to the PNG format allows it to specify information about how to stretch it and place things inside of it.
Shape: contains simple drawing commands instead of a raw bitmap, allowing it to resize better in some cases.
Layers: a compound drawable, which draws multiple underlying drawables on top of each other.
States: a compound drawable that selects one of a set of drawables based on its state.
Levels: a compound drawable that selects one of a set of drawables based on its level.
Scale: a compound drawable with a single child drawable, whose overall size is modified based on the current level.
Drawable - 作为Android平下通用的图形对象,它可以装载常用格式的图像,比如GIF、PNG、JPG,当然也支持BMP,当然还提供一些高级的可视化对象,比如渐变、图形等。
A bitmap is a Drawable. A Drawable is not necessarily a bitmap. Like all thumbs are fingers but not all fingers are thumbs.
Bitmap是Drawable . Drawable不一定是Bitmap .就像拇指是指头,但不是所有的指头都是拇指一样.
The API dictates: API规定:
Though usually not visible to the application, Drawables may take a variety of forms: 尽管通常情况下对于应用是不可见的,Drawables 可以采取很多形式:
Bitmap: the simplest Drawable, a PNG or JPEG image. Bitmap: 简单化的Drawable, PNG 或JPEG图像.
Nine Patch: an extension to the PNG format allows it to specify information about how to stretch it and place things inside of it.
Shape: contains simple drawing commands instead of a raw bitmap, allowing it to resize better in some cases.
Layers: a compound drawable, which draws multiple underlying drawables on top of each other.
States: a compound drawable that selects one of a set of drawables based on its state.
Levels: a compound drawable that selects one of a set of drawables based on its level.
Scale: a compound drawable with a single child drawable, whose overall size is modified based on the current level.
小结:
对比项 显示清晰度 占用内存 支持缩放 支持色相色差调整 支持旋转 支持透明色 绘制速度 支持像素操作
Bitmap 相同 大 是 是 是 是 慢 是
Drawable 相同 小 是 否 是 是 快 否
Drawable在内存占用和绘制速度这两个非常关键的点上胜过Bitmap
转自:http://iaiai.iteye.com/blog/1991225
=============================================================
所以,如果仅仅是用ImageView显示一张图片的话,我们就用 Drawable 可能更好一些。
如果需要旋转等图片处理,就一定需要用到Bitmap了。
0 0
- Drawable和Bitmap的区别
- Drawable和Bitmap的区别
- Bitmap和Drawable的区别
- Drawable和Bitmap的区别
- Drawable和Bitmap的区别
- Drawable和Bitmap的区别
- Drawable和Bitmap的区别
- Drawable和Bitmap的区别
- Drawable和Bitmap的区别
- Drawable和Bitmap的区别
- Drawable和Bitmap区别
- Drawable和Bitmap区别
- Drawable、Bitmap、Canvas和Paint的区别
- Drawable、Bitmap、Canvas和Paint的区别
- Drawable、Bitmap、Canvas和Paint的区别
- Drawable、Bitmap、Canvas和Paint的区别
- Bitmap 和 Drawable 的区别及转换
- android Bitmap和Drawable的区别
- 目标检测的图像特征提取之HOG特征
- iOS 记录一下编译ffmpeg
- 彩虹表完全参考手册
- 守护线程setDaemon(true)
- 围棋人机大战:为什么AlphaGo不首先挑战中国棋手?(无责任猜测,不幸猜中不胜荣幸)
- Drawable和Bitmap的区别
- [CortexM3--CC26XX]Memory系统VIMS
- 算法导论编程第2章 线性查找
- Git学习笔记一
- Android 第五天重置版_网络编程2
- Android多媒体开发笔记-- AwesomePlayer基本框架及播放流程
- eclipse 配置utf-8编码格式
- ruby and rails development environment install
- jenkins+tomcat+maven 的环境下 grunt安装和使用