ICogGraphicMultiPen AddSimplePen Method Cognex VisionPro
Creates a simple pen with the specified attributes and returns the key.

Namespace: Cognex.VisionPro
Assembly: Cognex.VisionPro.Core (in Cognex.VisionPro.Core.dll) Version: 65.1.0.0
Syntax

int AddSimplePen(
	CogColorConstants color,
	int lineWidth,
	CogGraphicLineStyleConstants lineStyle
)

Return Value

Type: Int32

The returned pen key.

Events

Event TypeReason
CogGeneralContour Changed

Fires when the pen is added.

The following state flags may be affected:

    Exceptions

    ExceptionCondition
    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