| 包: | dji.open.pilot.base.ui.cameraview |
classSince MSDK 5.20.1
DrawingTextInfo
自定义文字叠加信息,用于在图传画面上实时叠加显示文字。
描述:
Members
method
ALIGN_LEFT
static final int ALIGN_LEFT = 0 |
水平对齐:锚点为文字左边界。
method
ALIGN_CENTER
static final int ALIGN_CENTER = 1 |
水平对齐:锚点为文字水平中心。
method
ALIGN_RIGHT
static final int ALIGN_RIGHT = 2 |
水平对齐:锚点为文字右边界。
method
method
getAnchor
Since MSDK 5.20.1OpenPoint getAnchor() |
获取文字锚点坐标。
返回值
| 类型 | 说明 |
|---|---|
OpenPoint | 锚点坐标(归一化,0.0~1.0),水平方向含义由 horizontalAlignment 决定,垂直方向固定为文字整体的垂直中心。 |
method
method
setAnchor
Since MSDK 5.20.1void setAnchor(OpenPoint anchor) |
设置文字锚点坐标。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
anchor | OpenPoint | 锚点坐标(归一化,0.0~1.0),水平方向含义由 horizontalAlignment 决定,垂直方向固定为文字整体的垂直中心。 |
method
method
getText
Since MSDK 5.20.1String getText() |
获取文字内容。
返回值
| 类型 | 说明 |
|---|---|
String | 文字内容,支持 \n 换行,空字符串时不绘制。 |
method
method
setText
Since MSDK 5.20.1void setText(String text) |
设置文字内容。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
text | String | 文字内容,支持 \n 换行,空字符串时不绘制。 |
method
method
getTextSize
Since MSDK 5.20.1float getTextSize() |
获取字号。
返回值
| 类型 | 说明 |
|---|---|
float | 字号(单位 sp)。 |
method
method
setTextSize
Since MSDK 5.20.1void setTextSize(float textSize) |
设置字号。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
textSize | float | 字号(单位 sp)。 |
method
method
getTextColor
Since MSDK 5.20.1int getTextColor() |
获取文字颜色。
返回值
| 类型 | 说明 |
|---|---|
int | 文字颜色(ARGB)。 |
method
method
setTextColor
Since MSDK 5.20.1void setTextColor(int textColor) |
设置文字颜色。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
textColor | int | 文字颜色(ARGB)。 |
method
method
getBackgroundColor
Since MSDK 5.20.1int getBackgroundColor() |
获取文字背景色。
返回值
| 类型 | 说明 |
|---|---|
int | 文字背景色(ARGB),alpha 通道为 0 时不绘制背景。 |
method
method
setBackgroundColor
Since MSDK 5.20.1void setBackgroundColor(int backgroundColor) |
设置文字背景色。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
backgroundColor | int | 文字背景色(ARGB),alpha 通道为 0 时不绘制背景。 |
method
method
getHorizontalAlignment
Since MSDK 5.20.1int getHorizontalAlignment() |
获取水平对齐方式。
返回值
| 类型 | 说明 |
|---|---|
int | 水平对齐方式,取值为 ALIGN_LEFT、ALIGN_CENTER、ALIGN_RIGHT。 |
method
method
setHorizontalAlignment
Since MSDK 5.20.1void setHorizontalAlignment(int horizontalAlignment) |
设置水平对齐方式。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
horizontalAlignment | int | 水平对齐方式,取值为 ALIGN_LEFT、ALIGN_CENTER、ALIGN_RIGHT。 |