Skip to content
旷野 edited this page May 26, 2019 · 2 revisions

The pageToPixel api call is used to convert page coordinates to pixel coordinates. Page coordinates are often supplied in javascript events but most logic deals with the pixel coordinate system. This API converts from one to the other

function pageToPixel(element, pageX, pageY);

Parameters:

  • element - the DOM element with the enabled image
  • pageX - the x value in the page coordinate system
  • pageY - the y value in the page coordinate system

Returns: Object with the following properties

  • x - The corresponding x value in the pixel coordinate system
  • y - The corresponding y value in the pixel coordinate system