0
votes

I have a byte array that I want to save it as a bitmap image. what should I do? I saw android.graphics.Bitmap and found several methods but I don't know which one is suitable. createBitmap(int width, int height, Bitmap.Config config), for example. I have width and height but how can I give it my byte array?

Thanks

1

1 Answers

1
votes

Check out the methods in the class BitmapFactory, e.g. public static Bitmap decodeByteArray(byte[] data, int offset, int length).

Offset should be 0 and the length should be array.length for you.