从.bmp图像创建BITMAP对象

时间:2012-04-02 03:11:39

标签: android bitmap

我有一个BMP图像,我希望将其转换为Android中的Bitmap对象。谁能解释我怎么做到这一点?

1 个答案:

答案 0 :(得分:5)

1)阅读.bmp文件

2)完成:))

实施例

  InputStream input = connection.getInputStream();
  Bitmap myBitmap = BitmapFactory.decodeStream(input);

以下是支持的位图格式的链接:

http://developer.android.com/guide/appendix/media-formats.html

< =包括JPEG(.jpg),GIF(.gif),PNG(.png)和BMP

相关问题