HALCON Reference Manual 10.0.2
Table of Contents / Graphics / Mouse ClassesClassesClasses | | | Operators

get_mposition_sub_pixget_mposition_sub_pixget_mposition_sub_pixGetMpositionSubPixGetMpositionSubPix (Operator)

Name

get_mposition_sub_pixget_mposition_sub_pixget_mposition_sub_pixGetMpositionSubPixGetMpositionSubPix — Query the subpixel mouse position.

Signature

get_mposition_sub_pix( : : WindowHandle : Row, Column, Button)

Herror get_mposition_sub_pix(const Hlong WindowHandle, double* Row, double* Column, Hlong* Button)

Herror T_get_mposition_sub_pix(const Htuple WindowHandle, Htuple* Row, Htuple* Column, Htuple* Button)

Herror get_mposition_sub_pix(const HTuple& WindowHandle, double* Row, double* Column, Hlong* Button)

double HWindow::GetMpositionSubPix(HTuple* Column, HTuple* Button) const

void HOperatorSetX.GetMpositionSubPix(
[in] VARIANT WindowHandle, [out] VARIANT* Row, [out] VARIANT* Column, [out] VARIANT* Button)

double HWindowX.GetMpositionSubPix(
[out] double* Column, [out] Hlong* Button)

static void HOperatorSet.GetMpositionSubPix(HTuple windowHandle, out HTuple row, out HTuple column, out HTuple button)

void HWindow.GetMpositionSubPix(out double row, out double column, out int button)

Description

get_mposition_sub_pixget_mposition_sub_pixget_mposition_sub_pixGetMpositionSubPixGetMpositionSubPix returns the subpixel accurate image coordinates of the mouse pointer in the output window and the mouse button pressed. These values are returned regardless of the state of the mouse buttons (pressed or not pressed). If more than one button is pressed, the sum of the individual buttons' values is returned. The possible values for ButtonButtonButtonButtonbutton are:

0:

No button,

1:

Left button,

2:

Middle button,

4:

Right button.

For graphics windows the coordinates RowRowRowRowrow and ColumnColumnColumnColumncolumn are expressed with consideration of the current image part (see set_partset_partset_partSetPartSetPart). For text windows the coordinates of the upper left corner are (-0.5,-0.5), while the coordinates of the lower right corner are (window height-0.5,window width-0.5) (see open_textwindowopen_textwindowopen_textwindowOpenTextwindowOpenTextwindow).

If only pixel accurate image coordinates are required, you can use the operator get_mpositionget_mpositionget_mpositionGetMpositionGetMposition.

Attention

get_mposition_sub_pixget_mposition_sub_pixget_mposition_sub_pixGetMpositionSubPixGetMpositionSubPix fails (returns FAIL) if the mouse pointer is not located within the window. In this case, no values are returned.

Parallelization

Parameters

WindowHandleWindowHandleWindowHandleWindowHandlewindowHandle (input_control)  window HWindow, HTupleHTupleHWindowX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong)

Window identifier.

RowRowRowRowrow (output_control)  point.y HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Row coordinate of the mouse position in the window.

ColumnColumnColumnColumncolumn (output_control)  point.x HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Column coordinate of the mouse position in the window.

ButtonButtonButtonButtonbutton (output_control)  integer HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Mouse button(s) pressed or 0.

Result

If the mouse pointer is not located within the window, 5 (H_MSG_FAIL) is returned.

Possible Predecessors

open_windowopen_windowopen_windowOpenWindowOpenWindow, open_textwindowopen_textwindowopen_textwindowOpenTextwindowOpenTextwindow

Alternatives

get_mbuttonget_mbuttonget_mbuttonGetMbuttonGetMbutton, get_mpositionget_mpositionget_mpositionGetMpositionGetMposition, get_mbutton_sub_pixget_mbutton_sub_pixget_mbutton_sub_pixGetMbuttonSubPixGetMbuttonSubPix

See also

open_windowopen_windowopen_windowOpenWindowOpenWindow, open_textwindowopen_textwindowopen_textwindowOpenTextwindowOpenTextwindow

Module

Foundation


Table of Contents / Graphics / Mouse ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH