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:
DocumentReader.setConfig({
    functionality: {
        cameraFrame: Enum.DocReaderFrame.MAX
    }
});
  • Set the thickness of the document borders in the video preview (in dp):
DocumentReader.setConfig({
    customization: {
        cameraFrameBorderWidth: 20
    }
});
  • Set the hex color code for the document borders in the default state:
DocumentReader.setConfig({
    customization: {
        cameraFrameDefaultColor: "#e02712"
    }
});
  • Set the hex color code for the document border in the document detected state:
DocumentReader.setConfig({
    customization: {
        cameraFrameActiveColor: "#3812e0"
    }
});
  • Define the shape of document borders:
DocumentReader.setConfig({
    customization: {
        cameraFrameShapeType: Enum.FrameShapeType.CORNER
    }
});
  • Define the length of the corner side in the corners shape mode (in dp):
DocumentReader.setConfig({
    customization: {
        cameraFrameLineLength: 20
    }
});
  • Change the corners' radius of the camera frame:
DocumentReader.setConfig({
    customization: {
        cameraFrameCornerRadius: 20
    }
});
  • Customize the beginning and ending of stroked lines of the camera frame:
DocumentReader.setConfig({
    customization: {
        cameraFrameLineCap: Enum.LineCap.Round
    }
});
  • Specify the offsetWidth for the camera frame (only for the portrait orientation):
DocumentReader.setConfig({
    customization: {
        cameraFrameOffsetWidth: 50
    }
});
  • Change the aspect ratio of the camera frame for portrait mode:
DocumentReader.setConfig({
    customization: {
        cameraFramePortraitAspectRatio: 1.0
    }
});
  • Change the aspect ratio of the camera frame for landscape mode:
DocumentReader.setConfig({
    customization: {
        cameraFrameLandscapeAspectRatio: 1.0
    }
});
  • Change the position of the camera frame to vertical:
DocumentReader.setConfig({
    customization: {
        cameraFrameVerticalPositionMultiplier: 0.5
    }
});

Next Steps