how to save capture image in sdcard?

后端 未结 6 2056
旧巷少年郎
旧巷少年郎 2021-01-27 11:19

I want to use default camera and capture image. i want save image in sdcard/photofolder/ and save filename as curenttime format in sdcard/photofolder/ also display capture imag

6条回答
  •  无人及你
    2021-01-27 11:45

    below code can help u

        private void takePicture() 
            {   cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
                startActivityForResult(cameraIntent, IMAGE_CAPTURE);
            }
    
     protected void onActivityResult(int requestCode, int resultCode, Intent data) { 
         if (requestCode == CAMERA_REQUEST) {   
         File dir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM);
         File output = new File(dir, "camerascript.png");
         }  
    }
    

提交回复
热议问题