Center Method

NI Vision for Visual Basic

Center Method

Syntax

CWIMAQViewer.Center x, y

Purpose

Moves the specified point of the image to the center of the viewer window.

Remarks

If the image is smaller than the viewer in either width or height, the viewer ignores the value in that dimension and centers the image in that dimension.

Parameters

x As Long

The x-coordinate of the point on which to center the viewer.

y As Long

The y-coordinate of the point on which to center the viewer.

Example

Private Sub Run_Click()
    'Zoom to a factor of 16
    CWIMAQViewer1.ZoomScale = 4
    
    'Display the pixel at 50, 50 in the center of the viewer
    CWIMAQViewer1.SetCenter CWIMAQVision1.MakePoint(50, 50)
End Sub