Code example for SurfaceView

Methods: getHeight, getWidth

0
    } 
     
    // callback from ARManager 
    public void cameraOpened() { 
    	if (maxCameraViewSize==null) {
    		maxCameraViewSize = new int[] {cameraView.getWidth(), cameraView.getHeight()};
    	} 
    	arManager.setPreferredPreviewSize(maxCameraViewSize[0], maxCameraViewSize[1]);
    	CameraUtils.setLargestCameraSize(arManager.getCamera());
    	//statusTextField.setText(arManager.getCamera().getParameters().getPictureSize().width+""); 
    	if (!flashButtonConfigured) {
    		configureFlashButton(); 
    		flashButtonConfigured = true;
    	} 
    } 
     
    public void cameraPreviewStarted() { 
    	// resize camera view to scaled size of preview image 
    	Camera.Size size = arManager.getCamera().getParameters().getPreviewSize();
    	int[] scaledWH = AndroidUtils.scaledWidthAndHeightToMaximum(
    			size.width, size.height, maxCameraViewSize[0], maxCameraViewSize[1]);