F_VN_CopyImageRegionToRegion
Copy an image region into another image region.
Syntax
Definition:
FUNCTION F_VN_CopyImageRegionToRegion : HRESULT
VAR_INPUT
ipSrcImage : ITcVnImage;
nXSrc : UDINT;
nYSrc : UDINT;
nWidth : UDINT;
nHeight : UDINT;
ipDestImage : ITcVnImage;
nXDest : UDINT;
nYDest : UDINT;
hrPrev : HRESULT;
END_VAR
Inputs
Name |
Type |
Description |
---|---|---|
ipSrcImage |
Source image | |
nXSrc |
UDINT |
Left boundary in ipSrcImage (inclusive 0-based index) |
nYSrc |
UDINT |
Upper boundary in ipSrcImage (inclusive 0-based index) |
nWidth |
UDINT |
ROI width |
nHeight |
UDINT |
ROI height |
ipDestImage |
Destination image (same type as ipSrcImage) | |
nXDest |
UDINT |
Left boundary in ipDestImage (inclusive 0-based index) |
nYDest |
UDINT |
Upper boundary in ipDestImage (inclusive 0-based index) |
hrPrev |
HRESULT indicating the result of previous operations (If SUCCEEDED(hrPrev) equals false, no operation is executed.) |
Further information
The function F_VN_CopyImageRegionToRegion
copies an image region of the input image ipSrcImage
to a place in the destination image ipDestImage
. The image region is specified by a rectangle with position and size, as with an ROI.
Application
The copying of an image area with a size [100, 100]
at the position aPosition
in the top left corner of the result image ipImageRes
looks like this, for example:
hr := F_VN_CopyImageRegionToRegion(
ipSrcImage := ipImageWork,
nXSrc := aPosition[0],
nYSrc := aPosition[1],
nWidth := 100,
nHeight := 100,
ipDestImage := ipImageRes,
nXDest := 0,
nYDest := 0,
hrPrev := hr
);
Samples
Related functions
- F_VN_CopyImage for copying the entire image
- F_VN_CopyImageRegion for copying an image region
- F_VN_CopyImageRegionToRegion for copying an image region to a certain position
Required License
TC3 Vision Base
System Requirements
Development environment | Target platform | PLC libraries to include |
---|---|---|
TwinCAT V3.1.4024.54 or later | PC or CX (x64) with PL50, e.g. Intel 4-core Atom CPU | Tc3_Vision |