카메라 프리뷰를 사용해서 사진을 찍는데 저장할때 회전이 되서 Orientation으로 조절은 한뒤에 비트맵 조절을 하여 저장을 시키도록 했는데요
비트맵 조절을 해서 저장을 시키니까 캡쳐속도가 느리네요
어떻게 개선하면 좋을까요?
private Camera.PictureCallback mPicture = new Camera.PictureCallback() {
@Override
public void onPictureTaken(byte[] data, Camera camera) {
long start = System.currentTimeMillis();
setCameraPictureOrientation(camera.getParameters());
int w = camera.getParameters().getPictureSize().width;
int h = camera.getParameters().getPictureSize().height;
BitmapFactory.Options options = new BitmapFactory.Options();
options.inPreferredConfig = Bitmap.Config.ARGB_8888;
Bitmap realImage = BitmapFactory.decodeByteArray(data, 0, data.length,options);
Matrix mtx = new Matrix();
mtx.postRotate(outputOrientation);
realImage = Bitmap.createBitmap(realImage,0,0,w,h,mtx,true);
ByteArrayOutputStream blob = new ByteArrayOutputStream();
realImage.compress(Bitmap.CompressFormat.JPEG,100,blob);
byte[] bitmapdata = blob.toByteArray();
File pictureFile = mCameraPresenter.SavePic(bitmapdata);
refreshGallery(pictureFile);
mCamera.startPreview();