2150 |
mathias |
1 |
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" >
|
|
|
2 |
<head>
|
|
|
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";
|
|
|
8 |
</style>
|
|
|
9 |
<!--
|
|
|
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>
|
|
|
12 |
-->
|
|
|
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");
|
|
|
20 |
|
|
|
21 |
makeShapes = function(){
|
|
|
22 |
var surface = dojox.gfx.createSurface("test", 500, 500);
|
|
|
23 |
// relative path with cubic beziers
|
|
|
24 |
surface
|
|
|
25 |
.createPath("m100 100 100 0 0 100c0 50-50 50-100 0s-50-100 0-100z")
|
|
|
26 |
.setStroke({color: "blue"})
|
|
|
27 |
.setFill("#ddd")
|
|
|
28 |
.setTransform({dx: -50, dy: -50})
|
|
|
29 |
;
|
|
|
30 |
// absolute path with cubic bezier
|
|
|
31 |
surface
|
|
|
32 |
.createPath("M100 100 200 100 200 200C200 250 150 250 100 200S50 100 100 100z")
|
|
|
33 |
.setStroke({color: "blue"})
|
|
|
34 |
.setFill("#ddd")
|
|
|
35 |
.setTransform({dx: 100, dy: -50})
|
|
|
36 |
;
|
|
|
37 |
// relative path with horizontal and vertical lines, and cubic beziers
|
|
|
38 |
surface
|
|
|
39 |
.createPath("m100 100h100v100c0 50-50 50-100 0s-50-100 0-100z")
|
|
|
40 |
.setStroke({color: "blue"})
|
|
|
41 |
.setFill("#ddd")
|
|
|
42 |
.setTransform({dx: 250, dy: -50})
|
|
|
43 |
;
|
|
|
44 |
// relative path with quadratic beziers
|
|
|
45 |
surface
|
|
|
46 |
.createPath("m100 100 100 0 0 100q0 50-75-25t-25-75z")
|
|
|
47 |
.setStroke({color: "blue"})
|
|
|
48 |
.setFill("#ddd")
|
|
|
49 |
.setTransform({dx: -50, dy: 150})
|
|
|
50 |
;
|
|
|
51 |
// absolute path with quadratic bezier
|
|
|
52 |
surface
|
|
|
53 |
.createPath("M100 100 200 100 200 200Q200 250 125 175T100 100z")
|
|
|
54 |
.setStroke({color: "blue"})
|
|
|
55 |
.setFill("#ddd")
|
|
|
56 |
.setTransform({dx: 100, dy: 150})
|
|
|
57 |
;
|
|
|
58 |
// relative path with horizontal and vertical lines, and quadratic beziers
|
|
|
59 |
surface
|
|
|
60 |
.createPath("m100 100h100v100q0 50-75-25t-25-75z")
|
|
|
61 |
.setStroke({color: "blue"})
|
|
|
62 |
.setFill("#ddd")
|
|
|
63 |
.setTransform({dx: 250, dy: 150})
|
|
|
64 |
;
|
|
|
65 |
};
|
|
|
66 |
|
|
|
67 |
dojo.addOnLoad(makeShapes);
|
|
|
68 |
|
|
|
69 |
</script>
|
|
|
70 |
</head>
|
|
|
71 |
<body>
|
|
|
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>
|
|
|
75 |
</body>
|
|
|
76 |
</html>
|