public class

CameraFrameCropController

extends Object
java.lang.Object
   ↳ com.sap.cloud.mobile.fiori.camera.CameraFrameCropController

Class Overview

Helper class for calculating the rect to be cropped on the camera preview. FioriCamera shows a CameraFrameView on the screen. CameraFrame acts as guiding tool for end user to place the image correctly within the crop bounded box. Rect of the crop bounded box is calculated based on the size of the preview image. This class controls the size and position of the crop rect displayed on CameraFrameView on camera preview.

Summary

Nested Classes
interface CameraFrameCropController.OnCropRectCalculated Callback for crop rect calculations  
Public Constructors
CameraFrameCropController()
Public Methods
Rect calculateCropRect(int left, int top, int right, int bottom)
void setCropFraction(float horizontalCropFraction, float verticalCropFraction)
Set what fraction of the width and height should be used as crop rect.
void setOnCropRectCalculated(CameraFrameCropController.OnCropRectCalculated onCropRectCalculated)
Set CameraFrameCropController.OnCropRectCalculated listener to listen for rect calculations
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public CameraFrameCropController ()

Public Methods

public Rect calculateCropRect (int left, int top, int right, int bottom)

public void setCropFraction (float horizontalCropFraction, float verticalCropFraction)

Set what fraction of the width and height should be used as crop rect.

Parameters
horizontalCropFraction width fraction to be used as crop rect
verticalCropFraction height fraction to be used as crop rect

public void setOnCropRectCalculated (CameraFrameCropController.OnCropRectCalculated onCropRectCalculated)

Set CameraFrameCropController.OnCropRectCalculated listener to listen for rect calculations