如何转换为位图在Android中,以可绘制的? [英] How to convert a Bitmap to Drawable in android?
本文介绍了如何转换为位图在Android中,以可绘制的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何转换位图图像绘制的?
How can I convert a Bitmap image to Drawable ?
谢谢, 法哈
推荐答案
听起来像是你要使用<一个href="http://developer.android.com/intl/de/reference/android/graphics/drawable/BitmapDrawable.html"><$c$c>BitmapDrawable$c$c>
Sounds like you want to use BitmapDrawable
从文档:
A 绘制对象
,它包装一个位图,可以
平铺,拉伸,或对齐。您
可以创建一个 BitmapDrawable
从
文件路径,一个输入流,通过
XML通货膨胀,或从位图
对象。
A
Drawable
that wraps a bitmap and can be tiled, stretched, or aligned. You can create aBitmapDrawable
from a file path, an input stream, through XML inflation, or from aBitmap
object.
这篇关于如何转换为位图在Android中,以可绘制的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文