Code example for Camera.Parameters

Methods: getSupportedPreviewSizes, setPreviewSize

0
	} 
 
	@Override 
	public void surfaceChanged(final SurfaceHolder pSurfaceHolder, final int pPixelFormat, final int pWidth, final int pHeight) { 
		final Parameters parameters = this.mCamera.getParameters(); 
		final List<Size> previewSizes = parameters.getSupportedPreviewSizes(); 
 
		// TODO Choose appropriate preview size. (Maybe try to get it as close to pWidth/pHeight as possible?) 
		final Size previewSize = previewSizes.get(0); 
 
		parameters.setPreviewSize(previewSize.width, previewSize.height); 
 
		this.mCamera.setParameters(parameters); 
		this.mCamera.startPreview(); 
	} 
	 
	// =========================================================== 
	// Methods 
	// =========================================================== 
 
	// ===========================================================