开发者

Converting String as a Bitmap in android

开发者 https://www.devze.com 2023-02-19 00:14 出处:网络
I am w开发者_运维问答orking on an application which transfers the image from one device to another

I am w开发者_运维问答orking on an application which transfers the image from one device to another device via bluetooth. Now my problem is, I am transfering the bitmap value as byte[] through bluetooth. Now how to resolve it again into bitmap...

Thanks in advance...


Use the BitmapFactory.decodeByteArray() method.

byte[] byteArray; // the data
int offset = 0; // offset into array
int length = 1024; // length of array
Bitmap bm = BitmapFactory.decodeByteArray(byteArray, offset, length);

I think for This string should be Base64 Format. Have a look on this Link for More Info


using the BitmapFactory you can convert the image

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号