Images: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) No edit summary |
A WASSERMANN (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
<jsxgraph with="500" height="500"> | <jsxgraph with="500" height="500"> | ||
var brd = JXG.JSXGraph.initBoard('jxgbox', {boundingbox:[-5,5,5,-5],axis:true}); | var brd = JXG.JSXGraph.initBoard('jxgbox', {boundingbox:[-5,5,5,-5],axis:true}); | ||
var urlImg = "http://jsxgraph.uni-bayreuth.de/distrib/ | var urlImg = "http://jsxgraph.uni-bayreuth.de/distrib/images/uccinello.jpg"; | ||
var im = brd.create('image',[urlImg, [-1,-1], [2*2.67181,2] ]); | var im = brd.create('image',[urlImg, [-1,-1], [2*2.67181,2] ]); | ||
</jsxgraph> | </jsxgraph> | ||
Line 16: | Line 16: | ||
<source lang="javascript"> | <source lang="javascript"> | ||
var brd = JXG.JSXGraph.initBoard('jxgbox', {boundingbox:[-5,5,5,-5],axis:true}); | var brd = JXG.JSXGraph.initBoard('jxgbox', {boundingbox:[-5,5,5,-5],axis:true}); | ||
var urlImg = "http://jsxgraph.uni-bayreuth.de/distrib/ | var urlImg = "http://jsxgraph.uni-bayreuth.de/distrib/images/uccinello.jpg"; | ||
var im = brd.create('image',[urlImg, [-1,-1], [5,3] ]); | var im = brd.create('image',[urlImg, [-1,-1], [5,3] ]); | ||
</source> | </source> | ||
[[Category:Examples]] | [[Category:Examples]] |
Revision as of 20:47, 1 January 2011
The JavaScript code
Images can be included with the command
var im = brd.create('image',[urlImg, [-1,-1], [2*2.67181,2] ]);
It has the parameters:
- urlImage: URL of the image. Data URLs are possible, but will not beshown in the Internet Explorer <8 and are restricted to max. 32kByte in the Internet Explorer 8.
- [x,y]: position of the lower left corner of the image.
- [w,h]: width and height of the image.
var brd = JXG.JSXGraph.initBoard('jxgbox', {boundingbox:[-5,5,5,-5],axis:true});
var urlImg = "http://jsxgraph.uni-bayreuth.de/distrib/images/uccinello.jpg";
var im = brd.create('image',[urlImg, [-1,-1], [5,3] ]);