CogPolygon FitToBoundingBox Method Cognex VisionPro 9.21
Adjust the shape's geometric properties so that the shape fits inside passed in rectangle.

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

public virtual void FitToBoundingBox(
	CogRectangle boundingRectangle
)

Parameters

boundingRectangle
Type: Cognex.VisionPro CogRectangle

The rectangle that the shape is to fit into.

Implements

ICogShape FitToBoundingBox(CogRectangle)
Exceptions

ExceptionCondition
ArgumentException

boundingRectangle is NULL.

Remarks

Adjusts the shape's geometric properties so that the shape fits inside a given rectangle.

Note: The coordinates of the bounding box must be given in the same coordinate space as the shape.

Different shapes behave differently when FitToBoundingBox(CogRectangle) is called.

Behavior of FitToBoundingBox(CogRectangle) with different shapesShapeBehavior

CogCircle
CogEllipse
CogRectangle
CogRectangleAffine
CogCoordinateAxes

The shaped is scaled to the size and location of the bounding rectangle.

CogCircularArc
CogCircularAnnulusSection
CogEllipticalArc
CogEllipticalAnnulusSection

The shape is scaled to the size and location of the bounding rectangle. The resulting shape covers the range from 0 to 270 degrees in pixel space.

CogLineSegment

The line segment is centered vertically and horizontally across the bounding rectangle.

CogLine

The line's reference point is centered in the bounding rectangle, and its rotation is maintained.

CogPolygon

The centroid of the polygon is centered in the bounding box.

CogPointMarker

The point is centered in the bounding rectangle.

See Also