Resource Base
Table of contents

DSDrawingStyleManager

The DSDrawingStyleManager class is the manager of DrawingStyles in Dynamsoft Camera Enhancer.

Definition

Assembly: DynamsoftCameraEnhancer.xcframework

  • Objective-C
  • Swift
  1. NS_ASSUME_NONNULL_BEGIN
    NS_SWIFT_NAME(DrawingStyleManager)
    @interface DSDrawingStyleManager : NSObject
    
  2. class DrawingStyleManager : NSObject
    

Methods

Method Description
getDrawingStyle Get the specified DrawingStyle.
createDrawingStyle Create an instance of the DrawingStyle and get the style ID.
getAllDrawingStyles Get all available DrawingStyles.

getDrawingStyle

Get the specified DrawingStyle.

  • Objective-C
  • Swift
  1. + (DSDrawingStyle *)getDrawingStyle:(NSInteger)styleId;
    
  2. class func getDrawingStyle(_ styleId: Int) -> DSDrawingStyle?
    

Parameters

styleId: Specify a style ID.

Return Value

The DrawingStyle with the specified ID.

Code Snippet

  • Objective-C
  • Swift
  1. DSDrawingStyle *style = [DSDrawingStyleManager getDrawingStyle:STYLE_BLUE_STROKE];
    
  2. if let style = DrawingStyleManager.getDrawingStyle(STYLE_BLUE_STROKE) {
    // Use the style
    }
    

createDrawingStyle

Create an instance of the DrawingStyle and get the style ID.

  • Objective-C
  • Swift
  1. + (NSInteger)createDrawingStyle:(UIColor *)strokeColor strokeWidth:(CGFloat)strokeWidth fillColor:(UIColor *)fillColor textColor:(UIColor *)textColor font:(UIFont *)font;
    
  2. class func createDrawingStyle(strokeColor: UIColor, strokeWidth: CGFloat, fillColor: UIColor, textColor: UIColor, font: UIFont) -> Int
    

Parameters

strokeColor: Set the stroke colour.
strokeWidth: Set the stroke width.
fillColor: Set the fill colour.
textColor: Set the text colour.
font: Set the font.

Return Value

The style ID of the created DrawingStyle.

getAllDrawingStyles

Get all available DrawingStyles.

  • Objective-C
  • Swift
  1. + (nullable NSArray<DSDrawingStyle*> *)getAllDrawingStyles;
    
  2. class func getAllDrawingStyles() -> [DSDrawingStyle]
    

Return Value

An array that contains all available DrawingStyles.

Code Snippet

  • Objective-C
  • Swift
  1. NSArray<DSDrawingStyle*> *styles = [DSDrawingStyleManager getAllDrawingStyles];
    
  2. let styles = DrawingStyleManager.getAllDrawingStyles()
    

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 +