Resource Base
Table of contents

DSDrawingItem

The DSDrawingItem class represents a base class for drawing items, which can be added to drawing layers to draw basic graphics on the view.

Definition

Assembly: DynamsoftCore.xcframework

  • Objective-C
  • Swift
  1. @interface DSDrawingItem : NSObject
    
  2. class DrawingItem : NSObject
    

Attributes

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.

Methods

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.

drawingStyleId

The DrawingStyle of the DrawingItem. If a DrawingItem holds a drawingStyleId, it will not use the default style of its layer.

  • Objective-C
  • Swift
  1. @property (assign, nonatomic) NSInteger drawingStyleId
    
  2. var drawingStyleId: Int { get set }
    

state

The state of the DrawingItem.

  • Objective-C
  • Swift
  1. @property (assign, nonatomic) DSDrawingItemState state
    
  2. var state: DSDrawingItemState { get set }
    

CoordinateBase

The coordinate base of the DrawingItem. The coordinate base is image by default.

  • Objective-C
  • Swift
  1. @property (assign, nonatomic, readonly) DSCoordinateBase CoordinateBase
    
  2. var CoordinateBase: DSCoordinateBase { get }
    

getMediaType

Get the media type of the DrawingItem.

  • Objective-C
  • Swift
  1. - (DSDrawingItemMediaType)getMediaType;
    
  2. func getMediaType() -> DSDrawingItemMediaType
    

addNote

Add a note to the DrawingItem.

  • Objective-C
  • Swift
  1. - (void)addNote:(DSNote *)note
        replace:(bool)replace;
    
  2. func addNote(_ note: DSNote, replace: Bool)
    

    Parameters

note: The DSNote object to add.

replace: Whether to replace the previous one when there already exists a DSNote with the same name.

getNote

Get the specified DSNote.

  • Objective-C
  • Swift
  1. - (DSNote *)getNote:(NSString *)noteName;
    
  2. func getNote(_ noteName: String) -> DSNote?
    

    Parameters

noteName: The name of the DSNote.

Return Value

The specified DSNote object.

hasNote

Check whether the specified Note exists.

  • Objective-C
  • Swift
  1. - (bool)hasNote:(NSString *)noteName;
    
  2. func hasNote(_ noteName: String) -> Bool
    

    Parameters

noteName: The name of the DSNote.

Return Value

Whether the specified Note exists.

updateNote

Update the content of the specified DSNote.

  • Objective-C
  • Swift
  1. - (void)updateNote:(NSString *)name
           content:(NSString *)content
      mergeContent:(bool)mergeContent;
    
  2. func updateNote(_ name: String, content: String, mergeContent: Bool)
    

Parameters

name: The name of the DSNote.
content: The content to add or replace with.
mergeContent: If true, merge the new content to the previous content. Otherwise, replace it.

deleteNote

Remove the specified DSNote with the specified name.

  • Objective-C
  • Swift
  1. - (void)deleteNote:(NSString *)name;
    
  2. func deleteNote(_ name: String)
    

Parameters

name: The name of the DSNote.

getAllNotes

Get all DSNotes of this DrawingItem.

  • Objective-C
  • Swift
  1. - (NSArray<DSNote *> *)getAllNotes;
    
  2. func getAllNotes() -> [Note]
    

Return Value

An array of DSNote.

clearNotes

Remove all DSNotes of this DrawingItem.

  • Objective-C
  • Swift
  1. - (void)clearNotes;
    
  2. func clearNotes()
    

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.10
    • Version 4.2.1
    • 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 +