Code example for Camera.Area

0
        int y = Math.round(e.getY());
        int previewWidth = mPreviewFrame.getWidth();
        int previewHeight = mPreviewFrame.getHeight();
        if (mMeteringArea == null) {
            mMeteringArea = new ArrayList<Area>();
            mMeteringArea.add(new Area(new Rect(), 1));
        } 
 
        // Convert the coordinates to driver format. 
        if (CameraSettings.TB_FULL_S3D_LAYOUT.equals(mPreviewLayout)) {
            calculateTapArea(mTouchWidth, mTouchHeight * 2, 1, x, y, previewWidth, previewHeight,
                    mMeteringArea.get(0).rect);
        } else if (CameraSettings.SS_FULL_S3D_LAYOUT.equals(mPreviewLayout)) {
            calculateTapArea(mTouchWidth * 2, mTouchHeight, 1, x, y, previewWidth, previewHeight,
                    mMeteringArea.get(0).rect);
        } else { 
            calculateTapArea(mTouchWidth, mTouchHeight, 1, x, y, previewWidth, previewHeight,
                    mMeteringArea.get(0).rect);
        } 
        // Set the metering area. 
        mListener.setTouchParameters();