Documentation
Table of contents

Thanks for downloading Dynamsoft Label Recognizer Package!

Your download will start shortly. If your download does not begin, click here to retry.

UI Configurations

In this article, you will learn:

  • How to highlight the text lines
  • How to add clickable torchlight button

Preparations

UI configuring APIs are all included in the CameraView class. All the UI configurations are implemented via the CameraView instance. You can use the following steps to get prepared for UI configurations. These steps are also mentioned in the Getting started.

import com.dynamsoft.dce.*;

How to Highlight Recognized Text Lines

Turn on/off the highlight overlay:

// Get the layer first.
DrawingLayer layer = cameraView.getDrawingLayer(DrawingLayer.DLR_LAYER_ID);
// Set the visible property to true or false to control the visibility.
layer.setVisible(true);

Set the style of the highlight overlays with a preset style:

// Get the layer first.
DrawingLayer layer = cameraView.getDrawingLayer(DrawingLayer.DLR_LAYER_ID);
// Change the style of the layer.
layer.setDefaultStyle(DrawingStyleManager.STYLE_BLUE_STROKE);

Set the style of the highlight overlays with a use defined style:

// Get the layer first.
DrawingLayer layer = cameraView.getDrawingLayer(DrawingLayer.DLR_LAYER_ID);
// Create a new DrawingStyle via the DrawingStyleManager.
int style = DrawingStyleManager.createDrawingStyle(R.color.white, 1.0f,R.color.white,R.color.white);
// Set the newly created DrawingStyle to the layer.
layer.setDefaultStyle(style);

How to Add a Clickable Torchlight Button

In the cameraView, there is a build-in clickable torch button that can control the status of the torchlight. By invoking APIs, you can control the parameters such as position, size and icon of the button.

To display the torch button on the UI:

// If you don't add any styles for the button, the torch will be displayed on the top left corner of the screen.
cameraView.setTorchButtonVisible(true);

If you set the position or images to nil value, they will be set to the default value.

// You can change the position, size, and displayed image of the button.
cameraView.setTorchButton(new Point(50,50),50,50,null,null);

This page is compatible for:

Version 7.5.0

Is this page helpful?

YesYes NoNo

In this article:

latest version

    • Latest version (3.2.30)
    • Version 3.x
      • Version 3.0.20
    • Version 2.x
      • Version 2.2.20
      • Version 2.0.0
    • Version 1.x
      • Version 1.2.1
      • Version 1.2.0
      • Version 1.0.0
    Change +
    © 2003–2024 Dynamsoft. All rights reserved.
    Privacy Statement / Site Map / Home / Purchase / Support