Base64.encode不想采用参数“图像”,我不知道如何弄清楚。我以前从未使用过Base64。使用Base64的字符串位图。如何解决它?
Bitmap bm = BitmapFactory.decodeStream(this.getContentResolver().openInputStream(uri));
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bm.compress(Bitmap.CompressFormat.JPEG, 100, baos); //bm is the bitmap object
byte[] image = baos.toByteArray();
String encodedImage = Base64.encode(image);
编辑:我使用的Base64 http://iharder.sourceforge.net/current/java/base64/
可能重复的[如何将图像转换为Base64字符串?](http://stackoverflow.com/questions/4830711/how-to-convert-a-image-into-base64-string) – 2012-07-09 10:20:22