AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / Desarrollar una aplicación o un sitio web / Controles, ventanas y páginas / Controles: tipos disponibles / Control Imagen con enlace
  • Overview
  • Retrieving the mouse coordinates
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Retrieving the coordinates of a click in a clickable image
Overview
If the click action of the image is set to "Server call", you can get the click coordinates when the image is clicked in the browser.
Depending on the mouse position, you can then perform a specific process (change color, display a new image, etc.).
Retrieving the mouse coordinates
The position of the mouse cursor can be retrieved in server code only. To retrieve the position of the mouse cursor, use the following functions:
ImageXPosReturns the horizontal position (X) of the mouse cursor in relation to the specified Image control.
ImageYPosReturns the vertical position (Y) of the mouse cursor in relation to the specified Image control.


Example: Displaying an information box with the mouse position in the clickable image (IMG_Click1).
// -- server code: Click on IMG_Click1
PositionX, PositionY are int
// Retrieve the position of the mouse in a clickable image
PositionX = ImageXPos()
PositionY = ImageYPos()
Info("You've clicked at position: ", PositionX, PositionY)
Remark: You can also use PageParameter with the POS parameter. For example:
// Retrieve the position of the mouse in a clickable image
Parameter is string = PageParameter("POS")
// Ex: Parameter ="15,23"
x,y are int
x = ExtractString(Parameter, 1, ",")
y = ExtractString(Parameter, 2, ",")
Versión mínima requerida
  • Versión 9
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 10/06/2022

Señalar un error o enviar una sugerencia | Ayuda local