Image

Element

Display of an external image.

Usage (signatures)
board.create('image', [url, coords, size]);
Parameters
Name Type Description
url String | function

Defines the location of the image data. Data URIs are possible.

coords Array

The array coords of format [[z], x, y] contains the user coordinates of the lower left corner of the image. [z,x, y] are homogeneous coordinates, [x,y] are the (usual) Euclidean coordinates. The elements can be NumberLike.

size Array

The array size of format [w, h] defines the image's width and height in user coordinates. The elements can be NumberLike.

Example
var im = board.create('image', ['https://jsxgraph.org/jsxgraph/distrib/images/uccellino.jpg', [-3, -2], [3, 3]]);

Attributes

Own

attractors

Description

List of attractor elements. If the distance of the image is less than attractorDistance the image is made to glider of this element.

Type
Array
Default Value
empty
Source
options.js, line 6170

cssClass

Description

Defines the CSS class used by the image. CSS attributes defined in this class will overwrite the corresponding JSXGraph attributes, e.g. opacity. The default CSS class is defined in jsxgraph.css.

Type
String
Overrides
JXG.Image#cssClass
Default Value
'JXGimage'
See
Source
options.js, line 6090

highlightCssClass

Description

Defines the CSS class used by the image when highlighted. CSS attributes defined in this class will overwrite the corresponding JSXGraph attributes, e.g. highlightFillOpacity. The default CSS class is defined in jsxgraph.css.

Type
String
Overrides
JXG.Image#highlightCssClass
Default Value
'JXGimageHighlight'
See
Source
options.js, line 6107

rotate

Description

Image rotation in degrees.

Type
Number
Default Value
0
Source
options.js, line 6125

snapSizeX

Description

Defines together with Image#snapSizeY the grid the image snaps on to. The image will only snap on user coordinates which are integer multiples to snapSizeX in x and snapSizeY in y direction. If this value is equal to or less than 0, it will use the grid displayed by the major ticks of the default ticks of the default x axes of the board.

Type
Number
Default Value
1
See
Source
options.js, line 6135

snapSizeY

Description

Defines together with Image#snapSizeX the grid the image snaps on to. The image will only snap on integer multiples to snapSizeX in x and snapSizeY in y direction. If this value is equal to or less than 0, it will use the grid displayed by the major ticks of the default ticks of the default y axes of the board.

Type
Number
Default Value
1
See
Source
options.js, line 6153

Inherited

Members

Own

none

Inherited

Methods

Own

none

Inherited

Events

Own

none

Inherited

Throws

If the element cannot be constructed with the given parent objects an exception is thrown.

Type
Exception

Details

Type
JXG.Image
Source
base/image.js, line 391

Extends