Android Camera Intent: how to get full sized photo?

前端 未结 7 1516
遇见更好的自我
遇见更好的自我 2020-11-22 16:35

I am using intent to launch camera:

Intent cameraIntent = new Intent(
    android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
getParent().startActivityForResu         


        
7条回答
  •  爱一瞬间的悲伤
    2020-11-22 17:12

    To capture maximum picture size from camera, i hope these simple steps will be quite useful

     public static Camera mCamera;
    
    Camera.Parameters parameters = mCamera.getParameters();
      parameters.getSupportedPictureSizes();
    List supportedSizes = parameters.getSupportedPictureSizes();
      mSizePicture1 = supportedSizes.get(0);
      int cameraSize = supportedSizes.size();
      mSizePicture2 = supportedSizes.get(cameraSize - 1);
    
        if (mSizePicture1.height < mSizePicture2.height)
           mSizePicture = supportedSizes.get(cameraSize - 1);
        else
           mSizePicture = supportedSizes.get(0);
    
    parameters.setPictureSize(mSizePicture.width, mSizePicture.height);
    

    Here, the supported size of the each mobile is taken, from that which size is maximum that is fixed as picture size to capture.

提交回复
热议问题