PointMarker FitToBoundingBox Method Cognex VisionPro 9.22

Adjust the shape's geometric properties so that the shape fits inside passed in rectangle.

Namespace: Cognex.Vision
Assembly: Cognex.Vision.Core.Net (in Cognex.Vision.Core.Net.dll) Version: 9.22.2.0
Syntax

public void FitToBoundingBox(
	Rectangle boundingRectangle
)

Parameters

boundingRectangle
Type: Cognex.Vision Rectangle
The rectangle that the shape is to fit into.

Implements

IShape FitToBoundingBox(Rectangle)
Remarks

Adjusts the shape's geometric properties so that the shape fits inside a given rectangle. The coordinates of the bounding box must be given in the same coordinate space as the shape. Different shapes behave differently when FitToBoundingBox(Rectangle) is called. Behavior of FitToBoundingBox(Rectangle) with different shapes

Shape

Behavior

Circle, Ellipse, Rectangle, RectangleAffine, CoordinateAxes

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

CircularArc, CircularAnnulusSection, EllipticalArc, EllipticalAnnulusSection

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.

LineSegment

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

Line

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

Polygon

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

PointMarker

The point is centered in the bounding rectangle.

See Also