2012-09-06 68 views

回答

0

您可以添加步驟將圖像保存在您自己的Camera Activity的PictureCallBack.onPictureTaken中。

下面是一個例子:

@Override 
    public void onPictureTaken(byte[] imageData, Camera camera) { 
     //Use imageData[] and save wherever you want 
     File imagefile = new File(filepath); // set a file path 
     FileOutputStream fos = new FileOutputStream(imagefile); 
     try { 
      fos.write(imageData); 
      fos.flush(); 
     } catch(Exception e) { 
      //Something wrong happened 
     } finally { 
      fos.close(); 
     } 
    } 

記住你AndroidManifest添加的權限:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 
0

您需要使用相機對象來實現自己的相機活動,並在每次拍攝後處理存儲圖像。

默認相機意向選項非常有限。

相關問題