Creates a simple pen with the specified attributes and returns the key.
Namespace: Cognex.VisionProAssembly: Cognex.VisionPro.Core (in Cognex.VisionPro.Core.dll) Version: 65.1.0.0
Syntax
Parameters
- color
- Type: Cognex.VisionPro CogColorConstants
The pen color.
- lineWidth
- Type: System Int32
The line width in pixels.
- lineStyle
- Type: Cognex.VisionPro CogGraphicLineStyleConstants
The line style.
Return Value
Type: Int32The returned pen key.
Events
| Event Type | Reason |
|---|---|
| CogGeneralContour Changed | Fires when the pen is added. The following state flags may be affected: |
Exceptions
| Exception | Condition |
|---|---|
| ArgumentException | lineWidth is < 1, or lineStyle is not in CogGraphicLineStyleConstants. |
Remarks
Creates a simple pen with the specified attributes and returns the key.
Note: AddSimplePen(CogColorConstants, Int32, CogGraphicLineStyleConstants) never returns the special key value 0 which means to use the default pen properties of the graphic.
See Also