PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

  • Overview
  • Retrieving the mouse coordinates
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Retrieving the coordinates of a click in a clickable image
Overview
If the clickable image used is a "Click area (sends click coordinates to server)" type, you can retrieve the position of the mouse cursor when clicking the image displayed in the browser.
Depending on the mouse position, you have the ability to perform a specific process (change the color, display a new image, ...).
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)
Note: You also have the ability to use PageParameter associated with POS. 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, ",")
Minimum required version
  • Version 9
Comments
Click [Add] to post a comment