ICogAcqROI GetROIXYWidthHeight Method Cognex VisionPro
Gets the ROI. The ROI allows a subset of the pixels defined by the video format to be returned by a call to CompleteAcquire.

Namespace: Cognex.VisionPro
Assembly: Cognex.VisionPro.Core (in Cognex.VisionPro.Core.dll) Version: 65.1.0.0
Syntax

void GetROIXYWidthHeight(
	out int x,
	out int y,
	out int width,
	out int height
)

Parameters

x
Type: System Int32 

The x-coordinate of the start of the ROI.

y
Type: System Int32 

The y-coordinate of the start of the ROI.

width
Type: System Int32 

The width of the ROI

height
Type: System Int32 

The height of the ROI.

Remarks

Sets the acquisition region of interest (ROI). The ROI allows a subset of the pixels defined by the video format to be returned by CompleteAcquire(Int32, Int32 , Int32 ).

Examples

using Cognex.VisionPro;

private CogFrameGrabbers myFrameGrabbers;
private ICogFrameGrabber myFrameGrabber;
private ICogAcqFifo myAcqFifo;

private void InitializeFifo()
{
    const string VIDEO_FORMAT = "Sony XC75 640x480";
    ICogAcqROI ROIParams;
    int x, y, width, height;

    myFrameGrabbers = new CogFrameGrabbers();
    myFrameGrabber = myFrameGrabbers[0];
    myAcqFifo = myFrameGrabber.CreateAcqFifo(VIDEO_FORMAT, 
        Cognex.VisionPro.CogAcqFifoPixelFormatConstants.Format8Grey, 0, false);

    ROIParams = myAcqFifo.OwnedROIParams;
    if (ROIParams != null)
        ROIParams.GetROIXYWidthHeight(x, y, width, height);
}
Imports Cognex.VisionPro

Private myFrameGrabbers As CogFrameGrabbers
Private myFrameGrabber As Cognex.VisionPro.ICogFrameGrabber
Private myAcqFifo As Cognex.VisionPro.ICogAcqFifo

Private Sub InitializeFifo()
    Const VIDEO_FORMAT = "Sony XC75 640x480"
    Dim ROIParams As Cognex.VisionPro.ICogAcqROI
    Dim x As Long, y As Long, width As Long, height As Long

    myFrameGrabbers = New CogFrameGrabbers
    myFrameGrabber = myFrameGrabbers.Item(0)
    myAcqFifo = myFrameGrabber.CreateAcqFifo(VIDEO_FORMAT, CogAcqFifoPixelFormatConstants.Format8Grey, 0, False)

    ROIParams = myAcqFifo.OwnedROIParams

    If Not ROIParams Is Nothing Then
        ROIParams.GetROIXYWidthHeight(x, y, width, height)
    End If
End Sub
See Also