RectDrawingItem
RectDrawingItem is a subclass of DrawingItem. Dynamsoft Camera Enhancer will draw the RectDrawingItem on the UI if it is created and added to the DCECameraView or DCEImageEditorView.
- Objective-C
- Swift
@interface RectDrawingItem (DrawingItem)class RectDrawingItem : DrawingItem
| Method Name | Description |
|---|---|
initWithRect |
The constructor of RectDrawingItem. Initialize the instance of RectDrawingItem. |
rect |
The property that indicates the Rect of the RectDrawingItem. |
drawingStyleId |
Get the drawing style of the current DrawingItem. |
state |
Set the state of the current DrawingItem. |
getMediaType |
Get the media type of the current DrawingItem. |
initWithRect
The constructor of RectDrawingItem. Initialize the instance of RectDrawingItem.
- Objective-C
- Swift
- (instancetype) initWithRect:(CGRect)rect;init(rect: CGRect)
Parameters
rect: A Rect that indicates the location of the RectDrawingItem.
Code Snippet
- Objective-C
- Swift
DrawingItem* drawingItem = [[RectDrawingItem alloc] initWithRect:rect];let drawingItem = RectDrawingItem.init(rect:rect)
rect
The property that indicates the Rect of the RectDrawingItem.
- Objective-C
- Swift
@property (assign, nonatomic, readonly) CGRect rect;var rect: CGRect { get }
drawingStyleId
The property that identifies the ID of the DrawingStyle.
- Objective-C
- Swift
@property (assign, nonatomic) NSInteger drawingStyleId;var drawingStyleId: Int { get set }
state
The property that indicates the state of the DrawingItem. View all available DrawingItem states in EnumDrawingItemState.
- Objective-C
- Swift
@property (assign, nonatomic) EnumDrawingItemState state;var state: EnumDrawingItemState { get set }
getMediaType
Get the media type of the DrawingItem.
- Objective-C
- Swift
- (EnumDrawingItemMediaType) getMediaType;func getMediaType() -> EnumDrawingItemMediaType
Return Value
The media type of the DrawingItem.
Code Snippet
- Objective-C
- Swift
EnumDrawingItemMediaType mediaType = [drawingItem getMediaType];let mediaType = drawingItem.getMediaType()