Mohan N
Mohan N

Reputation: 31

Android: Converting Strings to Bitmap

I am trying to convert the strings to bitmap by using the Base64 and BitmapFactory but unable to convert. Please can any one help me to convert strings to bitmap.

Thanks in Advance.

Upvotes: 0

Views: 1558

Answers (1)

MKJParekh
MKJParekh

Reputation: 34301

You can convert Base64 string to byte array,

and from the Byte Array you can decode Bitmap.

Using these 2 methods.

byte[] arr = Base64.decode(s, options);
Bitmap b = BitmapFactory.decodeByteArray(data, offset, length);

Upvotes: 1

Related Questions