layout | title | description | keywords | needAutoGenerateSidebar | noTitleIndex | needGenerateH3Content | breadcrumbText | permalink |
---|---|---|---|---|---|---|---|---|
default-layout |
iOS DCEDrawingLayer Class - Dynamsoft Camera Enhancer Documents |
This is the documentation - iOS DCEDrawingLayer Class page of Dynamsoft Camera Enhancer. |
Camera Enhancer, iOS, DCEDrawingLayer |
true |
true |
true |
iOS DCEDrawingLayer Class |
/programming/ios/auxiliary-api/dcedrawinglayer-v3.0.3.html |
The layers that contains DrawingItems
. Users can add configurations for the DrawingItems
via 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 . |
The constructor of the DCEDrawingLayer
class. Initialize the instance of the DCEDrawingLayer
class.
Parameters
id
: Indicates the id of the layer.
Remarks
Please initialize the DrawingLayers via the following methods:
The ID of the DrawingLayer
.
The ID can be one of the following:
DDN_LAYER_ID
DBR_LAYER_ID
DLR_LAYER_ID
USER_DEFINED_LAYER_BASE_ID
The property that stores all the DrawingItems
on the layer. This property determines which DrawingItems
will be displayed on the layer.
Add a list of DrawingItems
to the DrawingLayer
. These DrawingItems
will be appended to the property drawingItems
.
Parameters
items
: A list of DrawingItems
.
Code Snippet
>- Objective-C >- Swift > >1. ```objc // Create a new DrawingItem array. NSMutableArray *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. ```swift // 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 ```
Specify a style ID for all available DrawingItems
.
Parameters
styleId
: The style ID.
Code Snippet
>- Objective-C >- Swift > >1. ```objc [drawingLayer setDrawingStyleId:0]; ``` 2. ```swift drawingLayer.setDrawingStyleId(0) ```
Specify a style ID for the targeting DrawingItems
. The state
is a filter of the DrawingItems
. All the eligible DrawingItems
will be changed to the input style.
Parameters
styleId
: The style ID.
state
: The state of the DrawingItem
.
Code Snippet
>- Objective-C >- Swift > >1. ```objc [drawingLayer setDrawingStyleId:0 state:EnumDrawingItemStateSelected]; ``` 2. ```swift drawingLayer.setDrawingStyleId(0, state:EnumDrawingItemState.selected) ```
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.
Parameters
styleId
: The style ID.
state
: The state of the DrawingItem
.
mediaType
: The media type of the DrawingItem
.
Code Snippet
>- Objective-C >- Swift > >1. ```objc [drawingLayer setDrawingStyleId:0 state:EnumDrawingItemStateSelected mediaType:@[@(EnumDrawingItemMediaTypeRectangle), @(EnumDrawingItemMediaTypeQuadrilateral)]]; ``` 2. ```swift drawingLayer.setDrawingStyleId(0, state:EnumDrawingItemState.selected, mediaType:[EnumDrawingItemMediaType.quadrilateral.rawValue, EnumDrawingItemMediaType.rectangle.rawValue]) ```
The property that stores the visibility of the DrawingLayer
.
Remarks
When visible is true, the DrawingLayer
is visible. Otherwise, the DrawingLayer
is invisible.