Resource Base
Table of contents

TextDrawingItem Class

TextDrawingItem is a subclass of DrawingItem. Dynamsoft Camera Enhancer will draw the TextDrawingItem on the UI if it is created and added to the DCECameraView or DCEImageEditorView.

class com.dynamsoft.dce.TextDrawingItem extends DrawingItem
Method Descriptions
TextDrawingItem The constructor of TextDrawingItem. Create an instance of TextDrawingItem.
getMediaType Get the media type of the TextDrawingItem.
getText Get the Text of the TextDrawingItem.
getDrawingStyleId Get the drawing style of the current drawing item.
setDrawingStyleId Set the drawing style of the current drawing item.
getState Get the state of the current drawing item.
setState Set the state of the current drawing item.

 

TextDrawingItem

The constructor of TextDrawingItem. Create an instance of TextDrawingItem.

public TextDrawingItem(String text, android.graphics.Rect textRect);

Parameters

text: The text of the TextDrawingItem. textRect: The Rect that indicates the location of the TextDrawingItem.

Code Snippet

DrawingItem drawingItem = new TextDrawingItem(Text);

 

getMediaType

Get the media type of the TextDrawingItem.

public EnumDrawingItemMeidaType getMediaType();

Return Value

The media type of the TextDrawingItem.

Code Snippet

EnumDrawingItemMediaType mediaType = drawingItem.getMediaType();

 

getText

Get the Text of the TextDrawingItem.

public String getText();

Return Value

The text content of the TextDrawingItem.

Code Snippet

String text = drawingItem.getText();

 

getTextRect

Get the Rect of the TextDrawingItem. It indicates the location of the TextDrawingItem.

public android.graphics.Rect getTextRect();

Return Value

The Rect of the TextDrawingItem.

Code Snippet

android.graphics.Rect rect = drawingItem.getTextRect();

 

getDrawingStyleId

Get the ID of the DrawingStyle that is applied on this DrawingItem.

public int getDrawingStyleId();

Return Value

An int value that representing the style ID.

Code Snippet

int styleId = drawingItem.getDrawingStyleId();

 

setDrawingStyleId

Set a DrawingStyle by ID for the DrawingItem.

public void setDrawingStyleId(int style);

Parameters

style: An int value that representing the style ID.

Code Snippet

drawingItem.setDrawingStyleId(0);

 

getState

Get the status of the DrawingItem.

public EnumDrawingItemState getState();

Return Value

The value that indicates the state of the DrawingItem. View all available DrawingItem states in EnumDrawingItemState.

Code Snippet

EnumDrawingItemState state = drawingItem.getState();

 

setState

Set the status of the DrawingItem.

public void setState(EnumDrawingItemState state);

Parameters

state: The value that indicates the state of the DrawingItem. View all available DrawingItem states in EnumDrawingItemState.

Code Snippet

drawingItem.setState(EnumDrawingItemState.DIS_SELECTED)

 

This page is compatible for:

Version 1.0

Is this page helpful?

YesYes NoNo

In this article:

version 3.0.3

  • Latest version
  • Version 4.x
    • Version 4.2.0
    • Version 4.0.2
    • Version 4.0.1
    • Version 4.0.0
  • Version 3.x
    • Version 3.0.3
    • Version 3.0.2
    • Version 3.0.1
    • Version 3.0.0
  • Version 2.x
    • Version 2.3.21
    • Version 2.3.20
    • Version 2.3.12
    • Version 2.3.11
    • Version 2.3.10
    • Version 2.3.5
    • Version 2.3.4
    • Version 2.3.3
    • Version 2.3.2
    • Version 2.3.1
    • Version 2.3.0
    • Version 2.1.4
    • Version 2.1.3
    • Version 2.1.1
    • Version 2.0.0
Change +