Jayakrishnan Salim
Jayakrishnan Salim

Reputation: 987

Displaying the captured image in full screen

In my application, I have to show the captured image from camera in full screen like in Snapshot. I could make the camera preview (surface view) to display in full screen. But when I display the captured image in ImageView, it is not displaying in the full screen.

Any help will be much appreciated.

Upvotes: 1

Views: 644

Answers (2)

Jayakrishnan Salim
Jayakrishnan Salim

Reputation: 987

I set the scale type property of Image view as 'centerCrop' (android:scaleType="centerCrop"). Now its working fine.

Upvotes: 0

hasanghaforian
hasanghaforian

Reputation: 14032

1- If you want your Activity be full screen,do some thing like this:

public class ActivityName extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // remove title
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.main);
    }
}

(more details here)

2- If you want your ImageView be full screen,create instance of ImageView then set it as ContentView of your Activity or create a layout that image view completely covers that and set that layout as ContentView.

Upvotes: 1

Related Questions