Mr.*_*ool 0 android bmp android-intent android-layout
我是android新手,我开发了一个示例应用程序,它从sd卡加载图像并使用图像视图控件显示为位图图像.现在我想修改我的应用程序,比如从字节数组加载bmp我有原始图像,宽度和高度,是否有任何人有这样的样本?
使用下面的代码将转换字节数组转换为位图,并将此位图显示到ImageView中.
Bitmap bmp = BitmapFactory.decodeByteArray(byteArray, 0, byteArray.length);
ImageView image = (ImageView) findViewById(R.id.imageView1);
image.setImageBitmap(bmp);
Run Code Online (Sandbox Code Playgroud)
并在下面看到SO链接了解更多信息.