当我点击按钮时表面和图像一起只保存表面我尝试下面的代码
camera.takePicture(shutterCallback, rawCallback, jpegCallback); ShutterCallback shutterCallback = new ShutterCallback() { public void onShutter() { Log.d(TAG, "onShutter'd"); } }; PictureCallback rawCallback = new PictureCallback() { public void onPictureTaken(byte[] data, Camera camera) { Log.d(TAG, "onPictureTaken - raw"); } }; PictureCallback jpegCallback = new PictureCallback() { public void onPictureTaken(byte[] data, Camera camera) { try { File root = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM),"Camera"); if (!root.exists()) { root.mkdirs(); } FileOutputStream f = new FileOutputStream(new File(root,System.currentTimeMillis()+".jpg")); int len1 = data.length; f.write(data,0, len1); f.close(); } catch (Exception e) { e.printStackTrace(); } finally { } } };
通过这个代码只获得表面,是否有可能与图像一起保存表面?如果有人知道请帮助我