DSRectDrawingItem
The DSRectDrawingItem class is a subclass of DSDrawingItem that represents a rectangular drawing item.
Definition
Assembly: DynamsoftCameraEnhancer.xcframework
- Objective-C
- Swift
@interface DSRectDrawingItem : DSDrawingItemclass RectDrawingItem : DrawingItem
Attributes
| Attributes | Type | Description |
|---|---|---|
rect |
CGRect | Get the rect information of the DSRectDrawingItem. |
Methods
| Method | Description |
|---|---|
initWithRect |
Create an instance of DSRectDrawingItem. |
initWithRect:coordinateBase |
Create an instance of DSRectDrawingItem. |
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. |
rect
Get the rect information of the DSRectDrawingItem.
- Objective-C
- Swift
@property(nonatomic, readonly) CGRect rect;var rect: CGRect { get }
initWithRect
Create an instance of DSRectDrawingItem.
- Objective-C
- Swift
- (instancetype)initWithRect:(CGRect)rect;init(rect: CGRect)Parameters
rect: A CGRect that defines the rect of the DSRectDrawingItem.
Return Value
An instance of DSRectDrawingItem.
Code Snippet
- Objective-C
- Swift
DSRectDrawingItem *item = [[DSRectDrawingItem alloc] initWithRect:rect];let item = RectDrawingItem(rect: rect)
initWithRect:coordinateBase
Create an instance of DSRectDrawingItem.
- Objective-C
- Swift
- (instancetype)initWithRect:(CGRect *)rect coordinateBase:(DSCoordinateBase)coordinateBase;init(rect: UnsafeMutablePointer<CGRect>, coordinateBase: CoordinateBase)Parameters
rect: A CGRect that defines the rect of the DSRectDrawingItem.
coordinateBase: The coordinate base of the DrawingItem.
Return Value
An instance of DSRectDrawingItem.
Code Snippet
- Objective-C
- Swift
DSRectDrawingItem *item = [[DSRectDrawingItem alloc] initWithRect:rect coordinateBase:coordinateBase];let item = RectDrawingItem(rect: &rect, coordinateBase: coordinateBase)