DSLineDrawingItem
The DSLineDrawingItem class is a subclass of DSDrawingItem and represents a line drawing item used for drawing line segments on the view.
Definition
Assembly: DynamsoftCameraEnhancer.xcframework
- Objective-C
- Swift
@interface DSLineDrawingItem : DSDrawingItemclass LineDrawingItem : DSDrawingItem
Attributes
| Attributes | Type | Description |
|---|---|---|
line |
DSLineSegment * | Get the line information of the DSLineDrawingItem. |
Methods
| Method | Description |
|---|---|
initWithLine |
Create an instance of DSLineDrawingItem. |
Interited Attributes
The following attributes are inherited from the base class DrawingItem.
| Attributes | Type | Description |
|---|---|---|
drawingStyleId |
NSInteger | The DrawingStyle of the DrawingItem. If a DrawingItem holds a drawingStyleId, it will not use the default style of its layer. |
state |
DSDrawingItemState | The state of the DrawingItem. |
CoordinateBase |
DSCoordinateBase | The coordinate base of the DrawingItem. The coordinate base is image by default. |
Interited Methods
The following methods are inherited from the base class DrawingItem.
| Method | Description |
|---|---|
getMediaType |
Get the media type of the DrawingItem. |
addNote |
Add a note to the DrawingItem. |
getNote |
Get the specified DSNote. |
hasNote |
Check whether the specified Note exists. |
updateNote |
Update the content of the specified DSNote. |
deleteNote |
Remove the specified DSNote with the specified name. |
getAllNotes |
Get all DSNotes of this DrawingItem. |
clearNotes |
Remove all DSNotes of this DrawingItem. |
line
The property that stores the line information of the DSLineDrawingItem in a DSLineSegment object.
- Objective-C
- Swift
@property(nonatomic, readonly) DSLineSegment *line;var line: DSLineSegment { get }
initWithLine
Create an instance of DSLineDrawingItem.
- Objective-C
- Swift
- (instancetype)initWithLine:(DSLineSegment *)line;init(line: DSLineSegment)Parameters
line: A DSLineSegment object that stores the line coordinates information.
Return Value
An instance of DSLineDrawingItem.
Code Snippet
- Objective-C
- Swift
DSLineSegment *line = [[DSLineSegment alloc] init]; DSLineDrawingItem *item = [[DSLineDrawingItem alloc] initWithLine:line];let line = DSLineSegment() let item = DSLineDrawingItem(line: line)
initWithLine:coordinateBase:
Create an instance of DSLineDrawingItem.
- Objective-C
- Swift
- (instancetype)initWithLine:(DSLineSegment *)line coordinateBase:(DSCoordinateBase)coordinateBase;init(line: DSLineSegment, coordinateBase: DSCoordinateBase)
Parameters
line: A DSLineSegment object that stores the line coordinates information.
coordinateBase: The coordinate base of the DrawingItem.
Return Value
An instance of DSLineDrawingItem.
Code Snippet
- Objective-C
- Swift
DSLineSegment *line = [[DSLineSegment alloc] init]; DSLineDrawingItem *item = [[DSLineDrawingItem alloc] initWithLine:line coordinateBase:DSCoordinateBaseView];let line = DSLineSegment() let item = DSLineDrawingItem(line: line, coordinateBase: .view)