Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android camera portrait orientation

I am using camera in my app. I am just using intent to start camera

Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
        cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
        startActivityForResult(cameraIntent, 101);

The captured image automatically comes in landscape view. How do i make camera to capture images in portrait view

like image 867
Seshu Vinay Avatar asked Dec 15 '11 06:12

Seshu Vinay


1 Answers

If device has v2.2 or above you can rotate camera orientation to portrait using camera.setDisplayOrientation(90). In devices below to v2.2 the camera will only display in landscape orientation and thus image will come in landscape. Check these posts Using Camera in Portrait Orientation, Camera is wrong unless keyboard is open.

like image 145
anujprashar Avatar answered Sep 20 '22 15:09

anujprashar