Resource Base
Table of contents

DrawingLayer

The DrawingLayer class represents a drawing layer, which is used for managing and controlling drawing items.

Definition

Assembly: package com.dynamsoft.dce

class DrawingLayer

Constants

Constants Description
DDN_LAYER_ID The preset DrawingLayer of Dynamsoft Document Normalizer.
DBR_LAYER_ID The preset DrawingLayer of Dynamsoft Barcode Reader.
DLR_LAYER_ID The preset DrawingLayer of Dynamsoft Label Recognizer.
USER_REFINED_LAYER_BASE_ID The IDs of user defined Drawinglayers start from 100.

Methods

Method Description
DrawingLayer Create an DrawingLayer with the specified ID.
getId Get the layer ID of the layer.
setVisible Set/get the visibility of the layer.
isVisible Set/get the visibility of the layer.
addDrawingItems Add a group of DrawingItem to the layer.
setDrawingItems Set the DrawingItems to be displayed on the layer.
getDrawingItems Get all the DrawingItems on the layer.
setDefaultStyle(style) Set the default style of the layer.
setDefaultStyle(style,state,mediaType) Set the default style of the layer with filter options.
clearDrawingItems Remove all DrawingItems from the layer.

DrawingLayer

Create an DrawingLayer with the specified ID.

DrawingLayer(int id){}

getId

Get the layer ID of the layer.

int getId(){}

setVisible

Set the visibility of the layer.

void setVisible(boolean visible){}

Parameters

A boolean value that indicates the visibility of the layer.

isVisible

Get the visibility of the layer.

boolean isVisible(){}

Return Value

A boolean value that indicates the visibility of the layer.

addDrawingItems

Add a group of DrawingItem to the layer.

void addDrawingItems(Arraylist<DrawingItem> items){} 

Parameters

items: An array of DrawingItems to be added to the layer.

setDrawingItems

Set the DrawingItems to be displayed on the layer. The previously displayed DrawingItems are removed.

void setDrawingItems(Arraylist<DrawingItem> items){}

Parameters

items: An array of DrawingItems to be set on the layer.

getDrawingItems

Get all the DrawingItems on the layer.

Arraylist<DrawingItem> getDrawingItems(){}

Return Value

An array of DrawingItems

setDefaultStyle(style)

Set the default style of the layer. A DrawingItem on the layer will use the default style if it doesn’t hold a style attribute.

void setDefaultStyle(int styleId){}

Parameters

styleId: An ID of DrawingStyle.

setDefaultStyle(style,state,mediaType)

Set the default style of the layer with filter options. A DrawingItem on the layer will use the default style if it doesn’t hold a style attribute.

void setDefaultStyle(int styleId, int state, int mediaTypes){}

Parameters

drawingStyle: An ID of DrawingStyle.
drawingItemState: Specify a group of DrawingItem state. It filters which kinds of DrawingItems will use this default style.
drawingItemMediaType: Specify a group of DrawingItem media type. It filters which kinds of DrawingItems will use this default style.

clearDrawingItems

Remove all DrawingItems from the layer.

void clearDrawingItems(){}

This page is compatible for:

Is this page helpful?

YesYes NoNo

In this article: