Resource Base
Table of contents

DrawingStyleManager

DrawingStyleManager is the class for users to create and adjust DrawingStyles.

class com.dynamsoft.dce.DrawingStyleManager
Method Description
getDrawingStyle Get the DrawingStyle instance with the style ID.
createDrawingStyle Create a user-defined DrawingStyle and get the style ID.

getDrawingStyle

Get the DrawingStyle instance with the style ID.

public static DrawingStyle getDrawingStyle(int styleId);

Parameters

styleId: The ID of the target DrawingStyle.

Return Value

An instance of DrawingStyle.

Code Snippet

DrawingStyle defaultStyle = DrawingStyleManager.getDrawingStyle(DrawingStyleManager.STYLE_ORANGE_STROKE);

Remarks

There are 8 preset drawing styles.

ID Style Name
1 STYLE_BLUE_STROKE
2 STYLE_GREEN_STROKE
3 STYLE_ORANGE_STROKE
4 STYLE_YELLOW_STROKE
5 STYLE_BLUE_STROKE_FILL
6 STYLE_GREEN_STROKE_FILL
7 STYLE_ORANGE_STROKE_FILL
8 STYLE_YELLOW_STROKE_FILL

 

createDrawingStyle

Create a user-defined DrawingStyle and get the style ID.

public static int createDrawingStyle(int strokeColor, float strokeWidth, int fillColor, int textColor, int fontSize, String fontFamily);

Parameters

strokeColor: The stroke colour. strokeWidth: The width of the stroke (measured by px). fillColor: The fill colour. textColor: The text colour. fontSize: The font size (measured by sp). fontFamily: The font family.

Code Snippet

int myStyleId = styleManager.createDrawingStyle(0xff00ff00,2,0xff00ff00,0xff00ff00,12,"sans-serif")

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 +