Interface: Canvas

Canvas

Extends

Methods

findCorners(threshold, blurRatio, width, height) → {Array}

Detects the corners in the image represented by this canvas (using the FAST algorithm). Notice that this function is only available when the advanced API is enabled.
Parameters:
Name Type Description
threshold Integer Sensitivity of the corner-detection, higher value means more sensitive. Defaults to 30.
blurRatio Integer blurring-ratio of noise-reduction, if required. Set to 0 for disabling. Disabled by default.
width Integer Width of rectangle for corner-detection. Defaults to canvas-width.
height Integer Height of rectangle for corner-detection. Defaults to canvas-height.
Returns:
Array of corner-coordinates on the form x1,y1,x2,y2...
Type
Array

get(name) → {Object}

Gets the value of the specified property.
Parameters:
Name Type Description
name String The name of the property.
Inherited From:
Returns:
- The property's value.
Type
Object

getAPI()

Returns the FabricJS API. See FabricJS Documentation

getCanvas()

Returns the FabricJS Canvas-object related to this widget. See FabricjJS Canvas API

getId() → {ID}

Returns the ID of the widget.
Inherited From:
Returns:
- The ID of the widget
Type
ID

getValue() → {Object}

Returns the widget's value.
Inherited From:
Returns:
- The widget's value.
Type
Object

hide()

Hides the widget.
Inherited From:

isEnabled() → {Boolean}

Returns true if the widget is enabled.
Inherited From:
Returns:
- True if enabled, otherwise false.
Type
Boolean

set(name, value)

Sets the value of the specified property.
Parameters:
Name Type Description
name String The name of the property.
value Object The new value.
Inherited From:

setEnabled(Enabled)

Enables/disables the widget.
Parameters:
Name Type Description
Enabled Boolean True to enable the widget, false to disable.
Inherited From:

setLabel(Label)

Sets the label on the button.
Parameters:
Name Type Description
Label String Text or HTML to set as the label on this button.
Overrides:

setStyle(Object)

Set the widget-style
Parameters:
Name Type Description
Object Object with style-properties
Inherited From:

setValue()

Sets the widget's value.
Parameters:
Type Description
Object The new value.
Overrides:

show()

Shows the widget.
Overrides: