안드로이드에서 카메라로 사진을 찍어 bmp 파일로 만들려고 하는데 잘안되네요.
소스도 같이 올리니 틀린부분 좀 알려주세요.
@Override
  public void onPreviewFrame(byte[] data, android.hardware.Camera camera) {
   Log.i("onPreviewFrame", "onPreviewFrame Callback");
   Log.i("onPreviewFrame", "data : " + data + " length : " + data.length);
   if( camera != null && data != null) {
    camera.setPreviewCallback(null);
    File f = new File("/sdcard/Test1233.bmp");
    FileOutputStream fout = null;
    try {
     if( !f.exists() ) 
      f.createNewFile();
     fout = new FileOutputStream(f);
     Size size = mParameters.getPreviewSize();
     YuvImage yuv = new YuvImage(data, ImageFormat.NV21, size.width, size.height, null);
     ByteArrayOutputStream baos = new ByteArrayOutputStream();
     yuv.compressToJpeg(mRect, 75, baos);
     byte[] b = baos.toByteArray();
     mBitmap = BitmapFactory.decodeByteArray(b, 0, b.length);
     Log.i("onPreviewFrame", "mBitmap : " + mBitmap);
     Log.i("onPreviewFrame", "b : " + b);
     Log.i("onPreviewFrame", "length : " + b.length);
     Log.i("onPreviewFrame", "fout : " + fout);
     if( mBitmap != null )
      mBitmap.compress(Bitmap.CompressFormat.JPEG, 75, fout);
     fout.close();
    } catch (FileNotFoundException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
    } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    // TODO face detection
    startFaceDetection();
   }
  }
 }