Class Index | File Index

## Classes

- _global_
- Array
- fabric.Circle
- fabric.Color
- fabric.Element
- fabric.Element#cache
- fabric.Ellipse
- fabric.Group
- fabric.Image
- fabric.Intersection
- fabric.Line
- fabric.Object
- fabric.Path
- fabric.PathGroup
- fabric.Point
- fabric.Polygon
- fabric.Polyline
- fabric.Rect
- fabric.Text
- fabric.Triangle
- fabric.util
- fabric.util.array
- fabric.util.object
- fabric.util.string
- Function
- String

# Class fabric.Image

Extends fabric.Object.
Image
Defined in: image.class.js.

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| fabric.Image()

Field Summary
Field Attributes | Field Name and Description
--- | ---
| active
| bordervisibility
| cornervisibility
<static> | fabric.Image.CSS_CANVAS Default CSS class name for canvas
| maxheight
| maxwidth
| type

Fields borrowed from class fabric.Object:
  FX_DURATION, FX_TRANSITION, includeDefaultValues, MIN_SCALE_LIMIT, NUM_FRACTION_DIGITS, options, rotate, stateProperties

Method Summary
Method Attributes | Method Name and Description
--- | ---
| clone(callback) Returns a clone of an instance
| complexity() Returns complexity of an instance
<static> | fabric.Image.fromObject(object, callback) Creates an instance of fabric.Image from its object representation
<static> | fabric.Image.fromURL(url, callback, imgOptions) Creates an instance of fabric.Image from an URL string
| getElement() Returns image element which this instance if based on
| getNormalizedSize(oImg, maxwidth, maxheight) Resizes an image depending on whether maxwidth and maxheight are set up; Width and height have to mantain the same proportion in the final image as it was in the initial one.
| getOriginalSize() Returns original size of an image
| getSrc() Returns source of an image
| initialize(element, options) Constructor
| render(ctx, noTransform) Renders image on a specified context
| setBorderVisibility(visible) Sets border visibility
| setCornersVisibility(visible) Sets corner visibility
| setElement(element) Sets image element for this instance to a specified one
| toGrayscale(callback) Makes image grayscale
| toObject() Returns object representation of an instance
| toString() Returns string representation of an instance

Methods borrowed from class fabric.Object:
  callSuper, cloneAsImage, drawBorders, drawCorners, fxRemove, fxStraighten, get, getAngle, getCenter, getHeight, getWidth, hasStateChanged, intersectsWithObject, intersectsWithRect, isActive, isContainedWithinRect, isType, saveState, scale, scaleToHeight, scaleToWidth, set, setActive, setAngle, setCoords, setOpacity, setOptions, setSourcePath, straighten, toDatalessObject, toDataURL, toggle, toJSON, transform

Class Detail
fabric.Image()
Field Detail
{Boolean} active

{Boolean} bordervisibility

{Boolean} cornervisibility

<static> {String} fabric.Image.CSS_CANVAS
Default CSS class name for canvas

{Number} maxheight

{Number} maxwidth

{String} type
Method Detail
clone(callback)
Returns a clone of an instance

Parameters:
{Function} callback
  Callback is invoked with a clone as a first argument

{Number} complexity()
Returns complexity of an instance

Returns:
  {Number} complexity

<static> fabric.Image.fromObject(object, callback)
Creates an instance of fabric.Image from its object representation

Parameters:
object
  {Object}
callback
  {Function} optional

<static> fabric.Image.fromURL(url, callback, imgOptions)
Creates an instance of fabric.Image from an URL string

Parameters:
{String} url
  URL to create an image from
{Function} callback Optional
  Callback to invoke when image is created (newly created image is passed as a first argument)
{Object} imgOptions Optional
  Options object

{HTMLImageElement} getElement()
Returns image element which this instance if based on

Returns:
  {HTMLImageElement} image element

getNormalizedSize(oImg, maxwidth, maxheight)
Resizes an image depending on whether maxwidth and maxheight are set up; Width and height have to mantain the same proportion in the final image as it was in the initial one.

Parameters:
{Object} oImg
{Number} maxwidth
  maximum width of the image (in px)
{Number} maxheight
  maximum height of the image (in px)

{Object} getOriginalSize()
Returns original size of an image

Returns:
  {Object} object with "width" and "height" properties

{String} getSrc()
Returns source of an image

Returns:
  {String} Source of an image

initialize(element, options)
Constructor

Parameters:
{HTMLImageElement | String} element
  Image element
{Object} options
  optional

render(ctx, noTransform)
Renders image on a specified context

Parameters:
{CanvasRenderingContext2D} ctx
  Context to render on
noTransform

setBorderVisibility(visible)
Sets border visibility

Parameters:
{Boolean} visible
  When true, border is set to be visible

setCornersVisibility(visible)
Sets corner visibility

Parameters:
{Boolean} visible
  When true, corners are set to be visible

{fabric.Image} setElement(element)
Sets image element for this instance to a specified one

Parameters:
{HTMLImageElement} element

Returns:
  {fabric.Image} thisArg

toGrayscale(callback)
Makes image grayscale

Parameters:
{Function} callback

{Object} toObject()
Returns object representation of an instance

Returns:
  {Object} Object representation of an instance

{String} toString()
Returns string representation of an instance

Returns:
  {String} String representation of an instance

Documentation generated by JsDoc Toolkit 2.4.0 on Thu Oct 14 2010 21:41:43 GMT-0400 (EDT)