【发布时间】:2012-04-28 19:55:50
【问题描述】:
我有一个位图,我想通过将其编码为 base64 将其发送到服务器,但我不想以 png 或 jpeg 压缩图像。
现在我之前做的是。
ByteArrayOutputStream byteArrayBitmapStream = new ByteArrayOutputStream();
bitmapPicture.compress(Bitmap.CompressFormat.PNG, COMPRESSION_QUALITY, byteArrayBitmapStream);
byte[] b = byteArrayBitmapStream.toByteArray();
//then simple encoding to base64 and off to server
encodedImage = Base64.encodeToString(b, Base64.NO_WRAP);
现在我不想使用任何压缩,也不想使用任何格式的简单字节 [] 来自我可以编码并发送到服务器的位图。
任何指针?
【问题讨论】:
标签: android bitmap bytearray base64