Skip to content

getDefaultViewportForImage api

Chris Hafey edited this page Jun 16, 2015 · 1 revision

The getDefaultViewportForImage api call is used to calculate the default Viewport if an image were to be displayed in an enabled element. The default Viewport will set the ww/wc to the default values from the image object and reset the transform so the image is fit to window.

function getDefaltViewportForImage(element, image);

Parameters:

  • element - the DOM element that is enabled
  • image - the image to use to calculate the default viewport

Returns: Viewport object