Web Demos

BARCODE READER SDK DEMO

Explore the flexibe barcode reading settings to optimize for your specific usage scenario.

WEB TWAIN SDK DEMO

Try the most popular web scanner features: scan images, import local images and PDF files, edit, save to local, upload to database, and etc.

BARCODE READER JAVASCRIPT DEMO

Transform any camera-equipped devices into real-time, browser-based barcode and QR code scanners.

MRZ SCANNER WEB DEMO

Detects the machine-readable zone of a passport, scans the text, and parses into human-readable data.

APP STORE DEMOS

BARCODE READER SDK FOR IOS

BARCODE READER SDK FOR ANDROID

VIEW MORE DEMOS >
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.

DCEDrawingLayer

The layers that contains DrawingItems. Users can add configurations for the DrawingItems via DCEDrawingLayer

@interface DCEDrawingLayer
Method Name Description
initWithId The constructor of the DCEDrawingLayer class.
id Get the DrawingLayer ID of the DrawingLayer.
drawingItems A list of DrawingItems.
addDrawingItems Add a list of DrawingItems to the DrawingLayer. These DrawingItems will be appended to the DrawingItem list of the current DrawingLayer.
setDrawingStyleId Set the DrawingStyle of the DrawingLayer by ID.
setDrawingStyleId:state: Set the DrawingStyle of the DrawingLayer by ID.
setDrawingStyleId:state:mediaType: Set the DrawingStyle of the DrawingLayer by ID.
visible The property that stores the visibility of the DrawingLayer.

 

initWithId

The constructor of the DCEDrawingLayer class. Initialize the instance of the DCEDrawingLayer class.

- (instancetype) initWithId:(NSInteger)id;

Parameters

id: Indicates the id of the layer.

Remarks

Please initialize the DrawingLayers via the following methods:

 

id

The ID of the DrawingLayer.

@property (assign, nonatomic) NSInteger id;

The ID can be one of the following:

  • DDN_LAYER_ID
  • DBR_LAYER_ID
  • DLR_LAYER_ID
  • USER_DEFINED_LAYER_BASE_ID

 

drawingItems

The property that stores all the DrawingItems on the layer. This property determines which DrawingItems will be displayed on the layer.

@property (nonatomic, strong, readwrite, nullable) NSArray<DrawingItem *> *drawingItems;

addDrawingItems

Add a list of DrawingItems to the DrawingLayer. These DrawingItems will be appended to the property drawingItems.

- (void) addDrawingItems:(NSArray<DrawingItem*>*)items; 

Parameters

items: A list of DrawingItems.

Code Snippet

  • Objective-C
  • Swift
  1. // Create a new DrawingItem array.
    NSMutableArray<DrawingItem *> *array = [NSMutableArray array];
    // You can append QuadDrawingItems, RectDrawingItems and TextDrawingItems in the array.
    // For example, we use QuadDrawingItems here. The quad data here is obtained from Dynamsoft Document Normalizer
    for (iDetectedQuadResult *detectedQuadResult in [StaticClass instance].quadArr) {
       iQuadrilateral *quad = detectedQuadResult.location;
       QuadDrawingItem *quadItem = [[QuadDrawingItem alloc] initWithQuad:quad];
       [array addObject:quadItem];
    }
    layer.drawingItems = array;
    
  2. // Create a new DrawingItem array.
    var array:[DrawingItem]? = []
    // You can append QuadDrawingItems, RectDrawingItems and TextDrawingItems in the array.
    // For example, we use QuadDrawingItems here. The quad data here is obtained from Dynamsoft Document Normalizer
    for detectQuadResult in StaticClass.instance.quadArray{
       let quad = detectQuadResult.location
       let quadItem = QuadDrawingItem.init(quad: quad)
       array?.append(quadItem)
    }
    // Assign the new DrawingItem array to the drawingItems.
    layer.drawingItems = array
    

 

setDrawingStyleId

Specify a style ID for all available DrawingItems.

- (void) setDrawingStyleId:(NSInteger)styleId;

Parameters

styleId: The style ID.

Code Snippet

  • Objective-C
  • Swift
  1. [drawingLayer setDrawingStyleId:0];
    
  2. drawingLayer.setDrawingStyleId(0)
    

 

setDrawingStyleId:state:

Specify a style ID for the targeting DrawingItems. The stateis a filter of the DrawingItems. All the eligible DrawingItems will be changed to the input style.

- (void) setDrawingStyleId:(NSInteger)styleId
                     state:(EnumDrawingItemState)state;

Parameters

styleId: The style ID.
state: The state of the DrawingItem.

Code Snippet

  • Objective-C
  • Swift
  1. [drawingLayer setDrawingStyleId:0 state:EnumDrawingItemStateSelected];
    
  2. drawingLayer.setDrawingStyleId(0, state:EnumDrawingItemState.selected)
    

 

setDrawingStyleId:state:mediaType:

Specify a style ID for the targeting DrawingItems. The state and mediaType are filters of the DrawingItems. All the eligible DrawingItems will be changed to the input style.

- (void) setDrawingStyleId:(NSInteger)styleId
                     state:(EnumDrawingItemState)state
                mediaTypes:(NSArray*)mediaTypes;

Parameters

styleId: The style ID.
state: The state of the DrawingItem.
mediaType: The media type of the DrawingItem.

Code Snippet

  • Objective-C
  • Swift
  1. [drawingLayer setDrawingStyleId:0 state:EnumDrawingItemStateSelected mediaType:@[@(EnumDrawingItemMediaTypeRectangle), @(EnumDrawingItemMediaTypeQuadrilateral)]];
    
  2. drawingLayer.setDrawingStyleId(0, state:EnumDrawingItemState.selected, mediaType:[EnumDrawingItemMediaType.quadrilateral.rawValue, EnumDrawingItemMediaType.rectangle.rawValue])
    

 

visible

The property that stores the visibility of the DrawingLayer.


@property (assign, nonatomic) BOOL visible;

Remarks

When visible is true, the DrawingLayer is visible. Otherwise, the DrawingLayer is invisible.

Is this page helpful?

YesYes NoNo

In this article:

latest version

    • Latest version
    • Version 2.2.20
    • Version 2.2.11
    • Version 2.2.10
    • Version 2.2.0
    • Version 2.0.0
    • Version 1.2.1
    • Version 1.2
    • Version 1.0
    Change +
    © 2003–2023 Dynamsoft. All rights reserved.
    Privacy Statement / Site Map / Home / Purchase / Support