ImageMouseDown, ImageMouseMove, ImageMouseUp Events

NI Vision for Visual Basic

ImageMouseDown, ImageMouseMove, ImageMouseUp Events

Syntax

Sub ControlName_ImageMouseDown(Button, Shift, x, y)

Sub ControlName_ImageMouseMove(Button, Shift, x, y)

Sub ControlName_ImageMouseUp(Button, Shift, x, y)

Applies To

CWIMAQViewer

Purpose

ImageMouseDown fires when you click the control.

ImageMouseMove fires when you move the mouse over the control.

ImageMouseUp fires when you release the mouse on the control.

Remarks

This event does not fire if an empty image is attached to the viewer. These events are similar to the standard MouseDown/Move/Up events except that they return their coordinates in terms of image coordinates, not screen coordinates.

Note  These events do not trigger if an empty image is attached to the Viewer.

Parameters

Button As Integer

Specifies the state of the mouse buttons. The Button argument can be any combination of the following values: 1 for the left button, 2 for the right button, or 4 for the middle button. For example, if both the left and right mouse buttons are pressed, the Button argument is 3 (1 + 2).

Shift As Integer

Specifies the state of the <Shift> key, <Alt> key, and <Ctrl> key. The Shift argument can be any combination of the following values: 1 for <Shift> , 2 for <Ctrl> , or 4 for <Alt> . For example, if you press the <Shift> and <Ctrl> keys, the value is 3 (1 + 2).

x As Variant

Specifies the x-coordinate of the current pointer location in image coordinates.

y As Variant

Specifies the y-coordinate of the current pointer location in image coordinates.