绑定器事务android位图失败

时间:2013-04-15 11:38:08

标签: android android-camera bitmapimage

请在下面找到我正在尝试的代码片段。

PictureCallback mPicture = new PictureCallback() {
@Override
public void onPictureTaken(byte[] data, Camera camera) {            
Bitmap bMap = BitmapFactory.decodeByteArray(data, 0, data.length);
String encoded = encodeTobase64(bMap);
Intent i = new Intent(Photocapture.this, ConfirmCapture.class);
i.putExtra("img", encoded);
startActivity(i);           
}
};
protected String encodeTobase64(Bitmap image) {
Bitmap immagex = image;
ByteArrayOutputStream baos = new ByteArrayOutputStream();  
immagex.compress(Bitmap.CompressFormat.JPEG, 100, baos);
byte[] b = baos.toByteArray();
String imageEncoded = Base64.encodeToString(b,Base64.DEFAULT);      
return imageEncoded;
}   

当我执行此操作时,我的活页夹交易失败。我正在开发自定义相机应用程序。任何输入都将有助于继续!

0 个答案:

没有答案