Android中Bitmap与Drawable的区别有哪些?针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。Android Bitmap和Drawable的对比Bitmap -
Android中Bitmap与Drawable的区别有哪些?针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。
Android Bitmap和Drawable的对比
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.
--结束END--
本文标题: Android中Bitmap与Drawable的区别有哪些
本文链接: https://lsjlt.com/news/223059.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0