CompressFormat太慢了......
试试ByteBuffer。
※※※字节※※※的位图width = bitmap.getWidth();height = bitmap.getHeight();int size = bitmap.getRowBytes() * bitmap.getHeight();ByteBuffer byteBuffer = ByteBuffer.allocate(size);bitmap.copyPixelsToBuffer(byteBuffer);byteArray = byteBuffer.array();
※※※字节到位图※※※Bitmap.Config configBmp = Bitmap.Config.valueOf(bitmap.getConfig().name());Bitmap bitmap_tmp = Bitmap.createBitmap(width, height, configBmp);ByteBuffer buffer = ByteBuffer.wrap(byteArray);bitmap_tmp.copyPixelsFromBuffer(buffer);