Resource Base
Table of contents

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
  1. @interface DSLineDrawingItem : DSDrawingItem
    
  2. class 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
  1. @property(nonatomic, readonly) DSLineSegment *line;
    
  2. var line: DSLineSegment { get }
    

initWithLine

Create an instance of DSLineDrawingItem.

  • Objective-C
  • Swift
  1. - (instancetype)initWithLine:(DSLineSegment *)line;
    
  2. 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
  1. DSLineSegment *line = [[DSLineSegment alloc] init];
    DSLineDrawingItem *item = [[DSLineDrawingItem alloc] initWithLine:line];
    
  2. let line = DSLineSegment()
    let item = DSLineDrawingItem(line: line)
    

initWithLine:coordinateBase:

Create an instance of DSLineDrawingItem.

  • Objective-C
  • Swift
  1. - (instancetype)initWithLine:(DSLineSegment *)line
              coordinateBase:(DSCoordinateBase)coordinateBase;
    
  2. 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
  1. DSLineSegment *line = [[DSLineSegment alloc] init];
    DSLineDrawingItem *item = [[DSLineDrawingItem alloc] initWithLine:line coordinateBase:DSCoordinateBaseView];
    
  2. let line = DSLineSegment()
    let item = DSLineDrawingItem(line: line, coordinateBase: .view)
    

This page is compatible for:

Version 1.0

Is this page helpful?

YesYes NoNo

In this article:

latest version

    • 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 +