Skip to content

Camera Frame

A frame is cropped by the camera frame. If you set the camera frame to full screen, Core will crop the frame by phone borders. Note that using this setting may lead to lower performance because of the huge frame size. Any changes connected to the camera frame alter the scanning process.

  • To override the default cropping frame on the camera activity provided by the scenario, set:
DocReader.shared.functionality.cameraFrame = DocReaderFrame.max
[RGLDocReader shared].functionality.cameraFrame = RGLDocReaderFrameMax;
  • Set the thickness of the document borders in the video preview (in dp):
DocReader.shared.customization.cameraFrameBorderWidth = 10
[RGLDocReader shared].customization.cameraFrameBorderWidth = 10;
  • Set the hex color code for the document borders in the default state:
DocReader.shared.customization.cameraFrameDefaultColor = UIColor.red
[RGLDocReader shared].customization.cameraFrameDefaultColor = [UIColor redColor];
  • Set the hex color code for the document border in the document detected state:
DocReader.shared.customization.cameraFrameActiveColor = UIColor.purple
[RGLDocReader shared].customization.cameraFrameActiveColor = [UIColor purpleColor];
  • Define the shape of document borders:
DocReader.shared.customization.cameraFrameShapeType = CameraFrameShapeType.corners
[RGLDocReader shared].customization.cameraFrameShapeType = RGLCameraFrameShapeTypeCorners;
  • Define the length of the corner side in the corners shape mode (in dp):
DocReader.shared.customization.cameraFrameLineLength = 25
[RGLDocReader shared].customization.cameraFrameLineLength = 25;
  • Change the corners' radius of the camera frame:
DocReader.shared.customization.cameraFrameCornerRadius = 10
[RGLDocReader shared].customization.cameraFrameCornerRadius = 10;
  • Customize the beginning and ending of stroked lines of the camera frame:
DocReader.shared.customization.cameraFrameLineCap = CGLineCap.round
[RGLDocReader shared].customization.cameraFrameLineCap = kCGLineCapRound;
  • Specify the offsetWidth for the camera frame (only for the portrait orientation):
DocReader.shared.customization.cameraFrameOffsetWidth = 50
[RGLDocReader shared].customization.cameraFrameOffsetWidth = 50;
  • Change the aspect ratio of the camera frame for portrait mode:
DocReader.shared.customization.cameraFramePortraitAspectRatio = 1.0
[RGLDocReader shared].customization.cameraFramePortraitAspectRatio = 1.0;
  • Change the aspect ratio of the camera frame for landscape mode:
DocReader.shared.customization.cameraFrameLandscapeAspectRatio = 1.0
[RGLDocReader shared].customization.cameraFrameLandscapeAspectRatio = 1.0;
  • Change the position of the camera frame to vertical:
DocReader.shared.customization.cameraFrameVerticalPositionMultiplier = 0.5
[RGLDocReader shared].customization.cameraFrameVerticalPositionMultiplier = 0.5;

Next Steps