get Camera Preview Size For Video - Android Camera

Android examples for Camera:Camera Preview

Description

get Camera Preview Size For Video

Demo Code


//package com.java2s;

import android.hardware.Camera;
import android.media.CamcorderProfile;

public class Main {

    public static Camera.Size getCameraPreviewSizeForVideo(int cameraId,
            Camera camera) {/*from  w w  w .  j ava 2 s .  c o  m*/
        CamcorderProfile cameraProfile = CamcorderProfile
                .get(CamcorderProfile.QUALITY_HIGH);
        return camera.new Size(cameraProfile.videoFrameWidth,
                cameraProfile.videoFrameHeight);

    }
}

Related Tutorials