F_VN_CopyImageRegionToRegion

F_VN_CopyImageRegionToRegion 1:

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

F_VN_CopyImageRegionToRegion 2: Inputs

Name

Type

Description

ipSrcImage

ITcVnImage

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

ITcVnImage

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

HRESULT indicating the result of previous operations (If SUCCEEDED(hrPrev) equals false, no operation is executed.)

F_VN_CopyImageRegionToRegion 3: Return value

HRESULT

Weiterführende Informationen

Die Funktion F_VN_CopyImageRegionToRegion kopiert einen Bildausschnitt des Eingangsbildes ipSrcImage an eine Stelle im Zielbild ipDestImage. Der Bildausschnitt wird wie bei einer ROI durch ein Rechteck mit Position und Größe angegeben.

Anwendung

Das Kopieren eines [100, 100]-großen Bildbereichs an der Position aPosition in die linke obere Ecke des Ergebnisbildes ipImageRes sieht z. B. so aus:

hr := F_VN_CopyImageRegionToRegion(
    ipSrcImage  :=  ipImageWork,
    nXSrc       :=  aPosition[0],
    nYSrc       :=  aPosition[1],
    nWidth      :=  100,
    nHeight     :=  100,
    ipDestImage :=  ipImageRes,
    nXDest      :=  0,
    nYDest      :=  0,
    hrPrev      :=  hr
);

Beispiele

Verwandte Funktionen

Required License

TC3 Vision Base

System Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT V3.1. 4024.44 or later

PC or CX (x64) with PL50, e.g. Intel 4-core Atom CPU

Tc3_Vision