Assembly: Cognex.VisionPro.Core (in Cognex.VisionPro.Core.dll) Version: 65.1.0.0
Parameters
- simplePenKeyWhenNormal
- Type: System Int32
The pen to use to draw the graphic in its normal state.
- simplePenKeyWhenSelected
- Type: System Int32
The pen to use when the graphic is selected.
- simplePenKeyWhenDragged
- Type: System Int32
The pen to use when the graphic is dragged.
Return Value
Type: Int32The returned pen key.
| Event Type | Reason |
|---|---|
| CogGeneralContour Changed | Fires when the pen is added. The following state flags may be affected: |
| Exception | Condition |
|---|---|
| ArgumentException | The key value for one of the simple pens is unknown, or one of the pens is not a simple pen |
Creates an interactive pen based on the specified simple pens and returns the key. The specified simple pen keys must already exist, or you can specify 0 to use the contour's default for a particular state.
For example, the following line uses custom pens for the normal and dragged state and the contour's default SelectedColor, SelectedLineStyle, and SelectedLineWidthInScreenPixels for the selected state.
MyInteractivePenKey = Contour.CustomPens.AddInteractivePen(MyNormalPenKey, 0, MyDragPenKey)AddInteractivePen(Int32, Int32, Int32) never returns the special key value 0.