Bonjour j'utilise la librairie wz_jsgraphics.js qui se trouve http://www.walterzorn.com/jsgraphics/jsgraphics_e.htm je me sert donc de l'exemple :2. Functions to Draw Shapes de cette page mais lorsque je teste comme ci-dessous aucun dessin n'est fait. Est-ce moi qui fait mal l'appel de fonction. je suis sous ff
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<html>
<head>
 
<SCRIPT>
/***************************************outils de dessin********************************************/
 
 
function myDrawFunction()
{
  jg_doc.setColor("#00ff00"); // green
  jg_doc.fillEllipse(100, 200, 100, 180); // co-ordinates related to the document
  jg_doc.setColor("maroon");
  jg_doc.drawPolyline(new Array(50, 10, 120), new Array(10, 50, 70));
  jg_doc.paint(); // draws, in this case, directly into the document
 
  jg.setColor("#ff0000"); // red
  jg.drawLine(10, 113, 220, 55); // co-ordinates related to "myCanvas"
  jg.setColor("#0000ff"); // blue
  jg.fillRect(110, 120, 30, 60);
  jg.paint();
 
  jg2.setColor("#0000ff"); // blue
  jg2.drawEllipse(10, 50, 30, 100);
  jg2.drawRect(400, 10, 100, 50);
  jg2.paint();
}
 
var jg_doc = new jsGraphics(); // draw directly into document
var jg = new jsGraphics("myCanvas");
var jg2 = new jsGraphics("anotherCanvas");
 
//document.onclick=myDrawFunction();
 
 
/***************************************************************************************************/
</SCRIPT>
<SCRIPT src="wz_jsgraphics.js"></SCRIPT>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
 
</head>
<body style="background-color:#6699CC;"  onLoad="myDrawFunction();"><!--examens('2')-->
 
 
 
</body>
 
 
</html>
Merci