问题
I am using MediaStore.ACTION_IMAGE_CAPTURE intent to launch camera view and i am able to successfully capture the images and all working fine.
Sample code written below,
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);
// start the image capture Intent
startActivityForResult(intent, CAMERA_CAPTURE_IMAGE_REQUEST_CODE);
My concern is when camera is launched and there are additional icons like, mode, settings of camera can i somehow hide it. I have seen this happening when you use thir-dparty apps/chat apps like whatsapp or Viber or Hike there is just plain button to capture the image.
How do i disable additional stuffs being show on camera's photo/image capture screen which is launched through my app or is there any way to achieve this?
回答1:
These app are not using installed cam app for capturing they create thier own view with cam streaming.
Here is sample app with cam streaming library included.
Very Easy integration
Note: 1.4.1 well not compile then try with 1.2.3
compile 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.4.1'
@Override
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity);
Uri imageUri = ...;
mGPUImage = new GPUImage(this);
mGPUImage.setGLSurfaceView((GLSurfaceView) findViewById(R.id.surfaceView));
mGPUImage.setImage(imageUri); // this loads image on the current thread, should be run in a thread
mGPUImage.setFilter(new GPUImageSepiaFilter());
// Later when image should be saved saved:
mGPUImage.saveToPictures("GPUImage", "ImageWithFilter.jpg", null);
}
回答2:
My concern is when camera is launched and there are additional icons like, mode, settings of camera can i somehow hide it
No.
I have seen this happening when you use thir-dparty apps/chat apps like whatsapp or Viber or Hike there is just plain button to capture the image.
They are using the camera APIs directly, rather than launching some external application to take a picture.
来源:https://stackoverflow.com/questions/39038182/capture-image-with-camera-and-hide-additional-camera-settings