Skip to content

setToPixelCoordinateSystem api

Chris Hafey edited this page May 6, 2014 · 1 revision

The setToPixelCoordinateSystem api call is used to set the canvas context transformation matrix to the pixel coordinate system. It is recommended that event handlers that draw text or geometry on the image using canvas calls invoke this function before drawing.

function setToPixelCoordinateSystem(enabledElement, context, scale);

Parameters:

  • enabledElement - the internal enabled element data structure. This is provided in the CornerstoneImageRendered event
  • context - the canvas context to set the transformation matrix for
  • scale - optional scale to apply to the transformation matrix. This can be used to increase or reduce the precision of the coordinate space used when drawing. The main use for this is for smoother font scaling when zooming the image

Returns: Nothing