Resource Base
Table of contents

TextDrawingItem

TextDrawingItem is a subclass of DrawingItem. Dynamsoft Camera Enhancer will draw the TextDrawingItem on the UI if it is created and added to the DCECameraView or DCEImageEditorView.

  • Objective-C
  • Swift
  1. @interface TextDrawingItem (DrawingItem)
    
  2. class TextDrawingItem : DrawingItem
    
Method Name Description
initWithText The constructor of TextDrawingItem. Initialize the instance of TextDrawingItem.
text The property that indicates the text of the TextDrawingItem.
rect The CGRect property that indicates the location of the TextDrawingItem.
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.

 

initWithText

The constructor of TextDrawingItem. Initialize the instance of TextDrawingItem.

  • Objective-C
  • Swift
  1. - (instancetype) initWithText:(NSString*)text textRect(CGRect)textRect;
    
  2. init(text: String, rect: CGRect)
    

Parameters

text: The text of the TextDrawingItem. textRect: The CGRect that indicates the location of the TextDrawingItem.

Code Snippet

  • Objective-C
  • Swift
  1. DrawingItem* drawingItem = [[TextDrawingItem alloc] initWithText:@"" rect:rect];
    
  2. let drawingItem = TextDrawingItem.init(text:"Your-Text", rect:rect)
    

 

text

The property that indicates the text of the TextDrawingItem.

  • Objective-C
  • Swift
  1. @property (assign, nonatomic, readonly) NSString* text;
    
  2. var text: String { get }
    

 

rect

The CGRect property that indicates the location of the TextDrawingItem.

  • Objective-C
  • Swift
  1. @property (nonatomic, readonly) CGRect rect;
    
  2. var rect: CGRect { get }
    

 

drawingStyleId

The property that identifies the ID of the DrawingStyle.

  • Objective-C
  • Swift
  1. @property (assign, nonatomic) NSInteger drawingStyleId;
    
  2. 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
  1. @property (assign, nonatomic) EnumDrawingItemState state;
    
  2. var state: EnumDrawingItemState { get set }
    

 

getMediaType

Get the media type of the DrawingItem.

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

Return Value

The media type of the DrawingItem.

Code Snippet

  • Objective-C
  • Swift
  1. EnumDrawingItemMediaType mediaType = [drawingItem getMediaType];
    
  2. let mediaType = drawingItem.getMediaType()
    

This page is compatible for:

Version 1.0

Is this page helpful?

YesYes NoNo

In this article:

version 3.0.3

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