Assembly: Cognex.VisionPro.Core (in Cognex.VisionPro.Core.dll) Version: 83.0.0.0
Parameters
- image
- Type: Cognex.VisionPro ICogImage
The image to fit to.
- xScale
- Type: System Double
The amount to scale by in the x-direction. A value of 1.0 means to scale 100% in the x-direction.
- yScale
- Type: System Double
The amount to scale by in the x-direction. A value of 1.0 means to scale 100% in the y-direction.
| Exception | Condition |
|---|---|
| ArgumentException | image is NULL. |
| ArgumentException | xScale or yScale is <= 0.0 or > 1.0. |
Adjusts the shape's geometric properties such that its default size is based on the image and its SelectedSpaceName.
Different shapes behave differently when FitToImage(ICogImage, Double, Double) is called.
Behavior of FitToImage(ICogImage, Double, Double) with different shapesShapeBehaviorCogCircle
CogRectangle
CogRectangleAffine
CogCoordinateAxes
Scales the shape in the x- and y-directions according to the height and width of the image.
The ellipse is sized to fit just within the image after xScale and yScale have reduced the image size. The principal axes of the ellipse are aligned with the image, not with the selected space name.
CogCircularArc
CogCircularAnnulusSection
The arc or annulus section is centered in the image and sized to fit just within the image after xScale and yScale have reduced the image size. The resulting shape covers the range from 0 to 270 degrees in pixel space. The shape is guaranteed to be circular in the selected space name, but may not be circular in pixel space.
CogEllipticalArc
CogEllipticalAnnulusSection
The arc or annulus section is centered in the image and sized to fit just within the image after xScale and yScalehave reduced the image size. The resulting shape covers the range from 0 to 270 degrees in pixel space. The principal axes of the underlying ellipse are aligned with the image, not with the selected space name.
The line segment is centered vertically centered and is horizontal across the image. xScale scales to the width of the image. yScale is ignored.
The line's reference point is centered in the bounding rectangle, and its rotation is maintained. xScale and yScale are ignored.
The centroid of the polygon is centered in the image. xScale and yScale are ignored.
The point is centered in the bounding rectangle. xScale and yScale are ignored.