ResizeRegion (TcVnRectangle_DINT)
Expands or shrinks the given rectangle proportionally to its current size and/or by explicit absolute offsets. Horizontal and vertical scaling ratios define proportional size changes. If a scaling ratio equals 1.0, the corresponding minimum offset alone determines the size change. If a reference image is provided, the resulting rectangle is clipped to the image boundaries. If clipping occurs, the function returns S_FALSE.
Syntax
Definition:
HRESULT ResizeRegion(
HRESULT hrPrev,
TcVnRectangle_DINT& stSrcRect,
TcVnRectangle_DINT& stDestRect,
float fWidthRatio,
float fHeightRatio,
LONG nMinWidthOffset,
LONG nMinHeightOffset,
ITcVnImage* ipImage
)Parameters
|
Name |
Type |
Description |
|---|---|---|
|
hrPrev |
HRESULT indicating the result of previous operations (If SUCCEEDED(hrPrev) equals false, no operation is executed.) | |
|
stSrcRect |
Source rectangle to be expanded or shrunk. | |
|
stDestRect |
Resulting rectangle after expansion or shrinkage. | |
|
fWidthRatio |
float |
Horizontal scaling ratio. If fWidthRatio <> 1 (> 1 expand, < 1 shrink), the absolute value of nMinWidthOffset is used as a minimum width change constraint. If fWidthRatio = 1.0, the width change is defined exclusively by nMinWidthOffset. |
|
fHeightRatio |
float |
Vertical scaling ratio. If fHeightRatio <> 1 (> 1 expand, < 1 shrink), the absolute value of nMinHeightOffset is used as a minimum width change constraint. If fHeightRatio = 1.0, the height change is defined exclusively by nMinHeightOffset. |
|
nMinWidthOffset |
LONG |
Minimum width offset (in pixels), applied symmetrically around the rectangle center. If fWidthRatio <> 1.0, the absolute value of nMinWidthOffset defines the minimum width change. If fWidthRatio = 1.0, the sign defines the operation direction ( > 0 expand, < 0 shrink, = 0 no width change). |
|
nMinHeightOffset |
LONG |
Minimum height offset (in pixels), applied symmetrically around the rectangle center. If fHeightRatio <> 1.0, the absolute value of nMinHeightOffset defines the minimum height change. If fHeightRatio = 1.0, the sign defines the operation direction ( > 0 expand, < 0 shrink, = 0 no height change). |
|
ipImage |
Optional reference image that defines the cropping boundaries, set to 0 if not required. |
Required License
TC3 Vision Base
System Requirements
Development environment | Target platform | PLC libraries to include |
|---|---|---|
TwinCAT V3.1.4026 or later | PC or CX (x64) with min. PL50, e.g. Intel 4-core Atom CPU | Tc3_Vision |