0

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.

3
  • 2
    what have you done and what problem/error are you facing? Commented Nov 2, 2011 at 7:24
  • "unable to convert" => What is happening then? Commented Nov 2, 2011 at 7:25
  • 1
    just check out this stackoverflow.com/q/4837110/840861 Commented Nov 2, 2011 at 7:31

1 Answer 1

1

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);
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for the response i tried this but its returning null form the BitmapFactory.decodeByteArray().
Can you please suggest any other solution to convert strings to bitamp.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.