Leaper Vision Toolkit
中文 / English 2.x
Public 成员函数 | 属性
ILDrawable接口 参考

该接口类开放了可以改变一个可绘制对象的图形设置的接口。 更多...

类 ILDrawable 继承关系图:
LBarcodeResult LBarcodeResults LBlob LBlobResults LCalibPointPairs LAnnulusRegion LAnnulusSectorRegion LCircleRegion LCompoundRegion LEllipseRegion LMaskRegion LPolyRegion LRectRegion LRotRectRegion LText LEdgeGaugeResult LEdgeGaugeResult LShapeGaugeResult LShapeGaugeResult LArc LCircle LEllipse LLine LPoint LPoints LPolygon LRect LTransform LSortedArray LHistogram LCircleResult LCircleResults LLineResult LLineResults LContourResult LContourResults LCrossMarkResult LCrossMarkResults LPathResult LPathResults LDataList LOCRChar LOCRLine LOCRResult LMatchResult LMatchResults

Public 成员函数

void SetBrushColor (COLORREF color)
 
void SetDrawName (BOOL val)
 
void SetDrawPoint (int size, LPVPointShape shape)
 
void SetFont (LString family, int fontSize, COLORREF color, BOOL bold, BOOL italic, BOOL underline, BOOL strikeOut)
 
void SetFontColor (COLORREF color)
 
void SetFontFamily (LString family)
 
void SetFontHeight (int fontSize)
 
void SetPen (LPVPenStyle style, int penSize, COLORREF color)
 
void SetPenColor (COLORREF color)
 
void SetPenStyle (LPVPenStyle style)
 
void SetPenWidth (int penSize)
 

属性

COLORREF BrushColor [get, set]
 用于填充的笔刷颜色。 更多...
 
BOOL DrawName [get, set]
 是否在画布上绘制该对象的名称。 更多...
 
BOOL FontBold [get, set]
 文本是否加粗。 更多...
 
COLORREF FontColor [get, set]
 文本绘制颜色。 更多...
 
LString FontFamily [get, set]
 绘制文本时使用的字体家族名称,比如 "Arial"、"Tahoma"、"Sans-Serif" 等。 更多...
 
int FontHeight [get, set]
 字符或字符单元的高度,以逻辑单位计。 更多...
 
BOOL FontItalic [get, set]
 文本是否使用斜体。 更多...
 
BOOL FontStrikeOut [get, set]
 文本是否带删除线。 更多...
 
BOOL FontUnderline [get, set]
 文本是否带下划线。 更多...
 
COLORREF PenColor [get, set]
 描边笔颜色。 更多...
 
LPVPenStyle PenStyle [get, set]
 描边笔风格。 更多...
 
int PenWidth [get, set]
 描边笔宽度,有效范围为 1..31。 更多...
 
LPVPointShape PointShape [get, set]
 绘制点的形状,默认为十字。设置为 -1 表示使用全局配置。 更多...
 
int PointSize [get, set]
 绘制点的尺寸,默认为 5 个像素。设置为 -1 表示使用全局配置。 更多...
 
BOOL RandomBrushColor [get, set]
 笔刷是否处于随机色模式,详情参见 RandomPenColor。 更多...
 
BOOL RandomFontColor [get, set]
 字体是否处于随机色模式,详情参见 RandomPenColor。 更多...
 
BOOL RandomPenColor [get, set]
 描边笔是否处于随机色模式。设为 VARIANT_TRUE 后,后续 SetPen / SetPenColor 调用会重新随机生成颜色。 老路径(向 SetPen / SetPenColor 传入 LPVColorRandom)会隐式置位该开关,保持兼容。 更多...
 

详细描述

该接口类开放了可以改变一个可绘制对象的图形设置的接口。

所有提供了绘制功能的 LPV 类都实现这个类定义的所有接口。 使用这个接口类,需将 LPV 的类转换成 ILDrawable 接口类,然后通过该接口修改其描边笔、笔刷、字体等绘制属性。

以下列出了所有实现该接口的可绘制 LPV 类。

LPVCoreLibLRectRegion, LRotRectRegion, LCircleRegion, LPolyRegion, LMaskRegion, LAnnulusRegion, LEllipseRegion, LAnnulusSectorRegion LCompoundRegion
LPVGeomLibLPoint, LPoints, LCircle, LLine, LPolygon, LRect, LEllipse, LArc
LPVGeomXLibLSortedArray
LPVPatLibLMatchResult, LMatchResults
LPVCalibLibLCalibPointPairs
LPVImgProcLibLHistogram
LPVBlobLibLBlob, LBlobResults
LPVLocateLibLLineResult, LLineResults, LCircleResult, LCircleResults
LPVLocateXLibLPathResult, LPathResults, LContourResult, LContourResults
LPVGaugeLibLShapeGaugeResult
LPVMathLibLDataList
LPVBarcodeLibLBarcodeResult, LBarcodeResults
LPVOCRLibLOCRChar, LOCRLine, LOCRResult

示例代码

注:该接口在 Linux / MacOS 平台暂不可用。

成员函数说明

◆ SetBrushColor()

void SetBrushColor ( COLORREF  color)

设置用于填充的笔刷颜色

参数
[in]color笔刷颜色,也可以查看 ILSystem::GetColorRef
弃用:
请使用 BrushColor 属性代替

◆ SetDrawName()

void SetDrawName ( BOOL  val)

设置是否绘制该对象的名称

弃用:
请使用 DrawName 属性代替
参见
SetFont()
自从
2.12.0

◆ SetDrawPoint()

void SetDrawPoint ( int  size,
LPVPointShape  shape 
)

设置当前对象绘制时的点绘制配置

参数
[in]size设置绘制点的尺寸,默认设置为 5 个像素。传入 -1 表示使用全局配置。
[in]shape设置绘制点的形状,默认设置为十字
弃用:
请使用 PointSizePointShape 属性代替
自从
2.12.0

◆ SetFont()

void SetFont ( LString  family,
int  fontSize,
COLORREF  color,
BOOL  bold,
BOOL  italic,
BOOL  underline,
BOOL  strikeOut 
)

设置要绘制的文本的字体。如果设置 FontFamily 是 Arial 和 bold,则会优先搜索 Arial-bold 字体, 如果找不到,就使用 Arial 字体并自动生成加粗后的效果。如果不设置任何字体属性,会使用系统默认字体,通常是 MS Sans Serif。

参数
[in]family字体家族名称,比如 "Arial", "Tahomo", 和 "Sans-Serif" 等
[in]fontSize逻辑单位(比如毫米)的字符或字符单元的高度
[in]color文本颜色,也可以查看 ILSystem::GetColorRef
[in]bold文本加粗
[in]italic斜体字符
[in]underline字符下划线
[in]strikeOut删除线
弃用:
请使用 #FontFamily、#FontHeight、#FontColor、#FontBold、#FontItalic、#FontUnderline 和 FontStrikeOut 属性代替
参见
SetFontFamily(), SetFontHeight(), SetFontColor()

◆ SetFontColor()

void SetFontColor ( COLORREF  color)

设置文本颜色,保留其它字体属性不变

弃用:
请使用 FontColor 属性代替
参见
SetFont()

◆ SetFontFamily()

void SetFontFamily ( LString  family)

设置字体家族,保留其它字体属性不变

弃用:
请使用 FontFamily 属性代替
参见
SetFont()

◆ SetFontHeight()

void SetFontHeight ( int  fontSize)

设置字体高度,保留其它字体属性不变

弃用:
请使用 FontHeight 属性代替
参见
SetFont()

◆ SetPen()

void SetPen ( LPVPenStyle  style,
int  penSize,
COLORREF  color 
)

设置用于绘制路径的描边笔。如果不设置,默认会用一个宽度为1个像素的绿色实心描边笔。

参数
[in]style描边笔的风格
[in]penSize描边笔的宽度,至少为1个像素宽度,最多支持31像素宽度
[in]color描边笔的颜色,查看 ILSystem::GetColorRef
弃用:
请使用 #PenStyle、#PenWidth 和 PenColor 属性代替
参见
SetPenColor(), SetPenWidth(), SetPenStyle()

◆ SetPenColor()

void SetPenColor ( COLORREF  color)

设置描边笔的颜色,保持其它属性不变

弃用:
请使用 PenColor 属性代替
参见
SetPen().

◆ SetPenStyle()

void SetPenStyle ( LPVPenStyle  style)

设置描边笔风格,保持其它属性不变

弃用:
请使用 PenStyle 属性代替
参见
SetPen().

◆ SetPenWidth()

void SetPenWidth ( int  penSize)

设置描边笔的宽度,保持其它属性不变

弃用:
请使用 PenWidth 属性代替
参见
SetPen().

属性说明

◆ BrushColor

COLORREF BrushColor
getset

用于填充的笔刷颜色。

自从
2.22.0

◆ DrawName

BOOL DrawName
getset

是否在画布上绘制该对象的名称。

自从
2.22.0

◆ FontBold

BOOL FontBold
getset

文本是否加粗。

自从
2.22.0

◆ FontColor

COLORREF FontColor
getset

文本绘制颜色。

参见
FontFamily, FontHeight
自从
2.22.0

◆ FontFamily

LString FontFamily
getset

绘制文本时使用的字体家族名称,比如 "Arial"、"Tahoma"、"Sans-Serif" 等。

参见
FontHeight, FontColor
自从
2.22.0

◆ FontHeight

int FontHeight
getset

字符或字符单元的高度,以逻辑单位计。

参见
FontFamily, FontColor
自从
2.22.0

◆ FontItalic

BOOL FontItalic
getset

文本是否使用斜体。

自从
2.22.0

◆ FontStrikeOut

BOOL FontStrikeOut
getset

文本是否带删除线。

自从
2.22.0

◆ FontUnderline

BOOL FontUnderline
getset

文本是否带下划线。

自从
2.22.0

◆ PenColor

COLORREF PenColor
getset

描边笔颜色。

参见
PenWidth, PenStyle
自从
2.22.0

◆ PenStyle

LPVPenStyle PenStyle
getset

描边笔风格。

参见
PenColor, PenWidth
自从
2.22.0

◆ PenWidth

int PenWidth
getset

描边笔宽度,有效范围为 1..31。

参见
PenColor, PenStyle
自从
2.22.0

◆ PointShape

LPVPointShape PointShape
getset

绘制点的形状,默认为十字。设置为 -1 表示使用全局配置。

参见
PointSize
自从
2.22.0

◆ PointSize

int PointSize
getset

绘制点的尺寸,默认为 5 个像素。设置为 -1 表示使用全局配置。

参见
PointShape
自从
2.22.0

◆ RandomBrushColor

BOOL RandomBrushColor
getset

笔刷是否处于随机色模式,详情参见 RandomPenColor。

参见
RandomPenColor, RandomFontColor
自从
2.22.0

◆ RandomFontColor

BOOL RandomFontColor
getset

字体是否处于随机色模式,详情参见 RandomPenColor。

参见
RandomPenColor, RandomBrushColor
自从
2.22.0

◆ RandomPenColor

BOOL RandomPenColor
getset

描边笔是否处于随机色模式。设为 VARIANT_TRUE 后,后续 SetPen / SetPenColor 调用会重新随机生成颜色。 老路径(向 SetPen / SetPenColor 传入 LPVColorRandom)会隐式置位该开关,保持兼容。

参见
RandomBrushColor, RandomFontColor
自从
2.22.0