我有一个字节数组,我想将其保存为位图图像。我该怎么办? 我看到了android.graphics.Bitmap,发现了几种方法,但我不知道哪种方法合适。 例如,createBitmap(int width,int height,Bitmap.Config config)。我有宽度和高度,但我怎么能给它我的字节数组呢?
由于
答案 0 :(得分:1)
查看课程BitmapFactory
中的方法,例如public static Bitmap decodeByteArray(byte[] data, int offset, int length)
偏移量应为0,长度应为array.length
。