该接口类开放了可以改变一个可绘制对象的图形设置的接口。
更多...
|
| 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 类。
| LPVCoreLib | LRectRegion, LRotRectRegion, LCircleRegion, LPolyRegion, LMaskRegion, LAnnulusRegion, LEllipseRegion, LAnnulusSectorRegion LCompoundRegion |
| LPVGeomLib | LPoint, LPoints, LCircle, LLine, LPolygon, LRect, LEllipse, LArc |
| LPVGeomXLib | LSortedArray |
| LPVPatLib | LMatchResult, LMatchResults |
| LPVCalibLib | LCalibPointPairs |
| LPVImgProcLib | LHistogram |
| LPVBlobLib | LBlob, LBlobResults |
| LPVLocateLib | LLineResult, LLineResults, LCircleResult, LCircleResults |
| LPVLocateXLib | LPathResult, LPathResults, LContourResult, LContourResults |
| LPVGaugeLib | LShapeGaugeResult |
| LPVMathLib | LDataList |
| LPVBarcodeLib | LBarcodeResult, LBarcodeResults |
| LPVOCRLib | LOCRChar, LOCRLine, LOCRResult |
示例代码
C++
ILDrawable::Cast(drawable)->SetPenWidth(2);
ILDrawable::Cast(drawable)->SetPen(LPVPenStyle::LPVPenSolid, 1, LPVColor::LPVYellow);
C#
((ILDrawable)roi).SetPenWidth(2);
LPVColor
该枚举表示一些常用的颜色
Definition: LPVCore.idl:1573
LPVPenStyle
该枚举类型表示绘制路径用的描边风格
Definition: LPVCore.idl:1050
COM
((ILDrawablePtr)drawable)->SetPenWidth(2);
((ILDrawablePtr)drawable)->SetPen(LPVPenStyle::LPVPenSolid, 1, LPVColor::LPVYellow);
注:该接口在 Linux / MacOS 平台暂不可用。
◆ SetBrushColor()
| void SetBrushColor |
( |
COLORREF |
color | ) |
|
◆ SetDrawName()
| void SetDrawName |
( |
BOOL |
val | ) |
|
◆ SetDrawPoint()
设置当前对象绘制时的点绘制配置
- 参数
-
| [in] | size | 设置绘制点的尺寸,默认设置为 5 个像素。传入 -1 表示使用全局配置。 |
| [in] | shape | 设置绘制点的形状,默认设置为十字 |
- 弃用:
- 请使用 PointSize 和 PointShape 属性代替
- 自从
- 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 | ) |
|
◆ SetFontFamily()
| void SetFontFamily |
( |
LString |
family | ) |
|
◆ SetFontHeight()
| void SetFontHeight |
( |
int |
fontSize | ) |
|
◆ SetPen()
| void SetPen |
( |
LPVPenStyle |
style, |
|
|
int |
penSize, |
|
|
COLORREF |
color |
|
) |
| |
◆ SetPenColor()
| void SetPenColor |
( |
COLORREF |
color | ) |
|
◆ SetPenStyle()
◆ SetPenWidth()
| void SetPenWidth |
( |
int |
penSize | ) |
|
◆ BrushColor
◆ DrawName
◆ FontBold
◆ FontColor
◆ FontFamily
◆ FontHeight
◆ FontItalic
◆ FontStrikeOut
◆ FontUnderline
◆ PenColor
◆ PenStyle
◆ PenWidth
◆ PointShape
◆ PointSize
绘制点的尺寸,默认为 5 个像素。设置为 -1 表示使用全局配置。
- 参见
- PointShape
- 自从
- 2.22.0
◆ RandomBrushColor
◆ RandomFontColor
◆ RandomPenColor
描边笔是否处于随机色模式。设为 VARIANT_TRUE 后,后续 SetPen / SetPenColor 调用会重新随机生成颜色。 老路径(向 SetPen / SetPenColor 传入 LPVColorRandom)会隐式置位该开关,保持兼容。
- 参见
- RandomBrushColor, RandomFontColor
- 自从
- 2.22.0