1 <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" >
3 <title>Testing setPath and curves</title>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <style type="text/css">
6 @import "../../../dojo/resources/dojo.css";
7 @import "../../../dijit/tests/css/dijitTests.css";
10 The next line should include Microsoft's Silverligth.js, if you plan to use the silverlight backend
11 <script type="text/javascript" src="Silverlight.js"></script>
13 <script type="text/javascript" src="../../../dojo/dojo.js" djConfig="isDebug: true"></script>
14 <!--<script type="text/javascript" src="../path.js"></script>-->
15 <!--<script type="text/javascript" src="../vml.js"></script>-->
16 <!--<script type="text/javascript" src="../svg.js"></script>-->
17 <!--<script type="text/javascript" src="../silverlight.js"></script>-->
18 <script type="text/javascript">
19 dojo.require("dojox.gfx");
21 makeShapes = function(){
22 var surface = dojox.gfx.createSurface("test", 500, 500);
23 // relative path with cubic beziers
25 .createPath("m100 100 100 0 0 100c0 50-50 50-100 0s-50-100 0-100z")
26 .setStroke({color: "blue"})
28 .setTransform({dx: -50, dy: -50})
30 // absolute path with cubic bezier
32 .createPath("M100 100 200 100 200 200C200 250 150 250 100 200S50 100 100 100z")
33 .setStroke({color: "blue"})
35 .setTransform({dx: 100, dy: -50})
37 // relative path with horizontal and vertical lines, and cubic beziers
39 .createPath("m100 100h100v100c0 50-50 50-100 0s-50-100 0-100z")
40 .setStroke({color: "blue"})
42 .setTransform({dx: 250, dy: -50})
44 // relative path with quadratic beziers
46 .createPath("m100 100 100 0 0 100q0 50-75-25t-25-75z")
47 .setStroke({color: "blue"})
49 .setTransform({dx: -50, dy: 150})
51 // absolute path with quadratic bezier
53 .createPath("M100 100 200 100 200 200Q200 250 125 175T100 100z")
54 .setStroke({color: "blue"})
56 .setTransform({dx: 100, dy: 150})
58 // relative path with horizontal and vertical lines, and quadratic beziers
60 .createPath("m100 100h100v100q0 50-75-25t-25-75z")
61 .setStroke({color: "blue"})
63 .setTransform({dx: 250, dy: 150})
67 dojo.addOnLoad(makeShapes);
72 <h1>dojox.gfx setPath and curve test</h1>
73 <div id="test" style="width: 500px; height: 500px;"></div>
74 <p>That's all Folks!</p>