Skip to content

getDefaultViewport api

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

The getDefaultViewport api call is an internal API that returns a viewport object with reasonable defaults given a canvas and image object

function getDefaultViewport(canvas, image);

Parameters:

  • canvas - the canvas element created for an enabled element
  • image - the image object to be displayed in the canvas

Returns: viewport object with the image centered and scaled to fit all pixels