在Android的位图和绘制对象之间的区别是什么? [英] What is the difference between Bitmap and Drawable in Android?
问题描述
我GOOGLE了,但我找不到任何物品描述有关Android的位图和绘制对象之间的区别。
I googled but i couldn't find any article to describe about the difference between Bitmap and Drawable in Android.
推荐答案
一个位图是位图图像的再presentation(类似java.awt.Image中)。可拉伸的东西,可以得出的抽象。这可能是一个位图(包裹起来作为一个 BitmapDrawable
),但它也可以是单色,其它可绘制对象的集合,或任何数量的其他结构。
A Bitmap is a representation of a bitmap image (something like java.awt.Image). A Drawable is an abstraction of "something that can be drawn". It could be a Bitmap (wrapped up as a BitmapDrawable
), but it could also be a solid color, a collection of other Drawable objects, or any number of other structures.
大多数Android的UI框架的喜欢和拖拉的对象,而不是位图对象一起工作。视图可以接受任何可绘制对象作为背景。一个ImageView的可以显示前景绘制对象。作为资源存储的图像被加载拖拉的对象。
Most of the Android UI framework likes to work with Drawable objects, not Bitmap objects. A View can accept any Drawable as a background. An ImageView can display a foreground Drawable. Images stored as resources are loaded as Drawable objects.
这篇关于在Android的位图和绘制对象之间的区别是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!