DSDrawingStyleManager
The DSDrawingStyleManager
class is the manager of DrawingStyles in Dynamsoft Camera Enhancer.
Definition
Assembly: DynamsoftCameraEnhancer.xcframework
- Objective-C
- Swift
NS_ASSUME_NONNULL_BEGIN NS_SWIFT_NAME(DrawingStyleManager) @interface DSDrawingStyleManager : NSObject
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
+ (DSDrawingStyle *)getDrawingStyle:(NSInteger)styleId;
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
DSDrawingStyle *style = [DSDrawingStyleManager getDrawingStyle:STYLE_BLUE_STROKE];
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
+ (NSInteger)createDrawingStyle:(UIColor *)strokeColor strokeWidth:(CGFloat)strokeWidth fillColor:(UIColor *)fillColor textColor:(UIColor *)textColor font:(UIFont *)font;
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
+ (nullable NSArray<DSDrawingStyle*> *)getAllDrawingStyles;
class func getAllDrawingStyles() -> [DSDrawingStyle]
Return Value
An array that contains all available DrawingStyles.
Code Snippet
- Objective-C
- Swift
NSArray<DSDrawingStyle*> *styles = [DSDrawingStyleManager getAllDrawingStyles];
let styles = DrawingStyleManager.getAllDrawingStyles()