Android:如何在字节数组上创建位图图像?

时间:2010-12-02 14:33:51

标签: android image bitmap

我有一个字节数组,我想将其保存为位图图像。我该怎么办? 我看到了android.graphics.Bitmap,发现了几种方法,但我不知道哪种方法合适。 例如,createBitmap(int width,int height,Bitmap.Config config)。我有宽度和高度,但我怎么能给它我的字节数组呢?

由于

1 个答案:

答案 0 :(得分:1)

查看课程BitmapFactory中的方法,例如public static Bitmap decodeByteArray(byte[] data, int offset, int length)

偏移量应为0,长度应为array.length