new image(id)
Creates an image object
Parameters:
Name | Type | Description |
---|---|---|
id |
string | The id of the dom element containing the image |
Methods
GetAvailHeight()
gets available height (6.14.06)
GetAvailWidth()
gets available width (6.14.06)
GetFileInfo()
Returns file_info object that contains information about the
displayed image.
GetImRatio()
Returns the ratio of the available width/height to the original
width/height.
GetNewImage(onload_helper)
Fetches a new image based on the URL string or gets a new one at
Parameters:
Name | Type | Description |
---|---|---|
onload_helper |
function | pointer to a helper function that is called when the image is loaded. Typically, this will call obj.SetImageDimensions(). |
IsFitImage()
Returns true if the image is zoomed to the original (fitted) resolution.
IsPointVisible()
Returns true if (x,y) is viewable.
ScaleFrame()
Tells the picture to take up the available space in the browser, if it needs it. 6.29.06
ScrollbarsOff()
Turn off image scrollbars if zoomed in.
ScrollbarsOn()
Turn on image scrollbars if zoomed in.
SetImageDimensions()
Sets the dimensions of the image based on browser setup.
SetOrigImDims(im)
Retrieves and sets the original image's dimensions (width/height).
Parameters:
Name | Type | Description |
---|---|---|
im |
image |
SlideWindow(x, y) → {intarray}
If (x,y) is not in view, then scroll it into view. Return adjusted
(x,y) point that takes into account the slide offset.
Parameters:
Name | Type | Description |
---|---|---|
x |
int | |
y |
int |
Returns:
- Type
- intarray
Zoom(amt)
Zoom the image given a zoom level (amt) between 0 and inf (or 'fitted').
Parameters:
Name | Type | Description |
---|---|---|
amt |
float | amount of zoom |