2150 |
mathias |
1 |
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" >
|
|
|
2 |
<head>
|
|
|
3 |
<title>Testing image</title>
|
|
|
4 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
|
5 |
<!--
|
|
|
6 |
The next line should include Microsoft's Silverligth.js, if you plan to use the silverlight backend
|
|
|
7 |
<script type="text/javascript" src="Silverlight.js"></script>
|
|
|
8 |
-->
|
|
|
9 |
<script type="text/javascript" src="../../../dojo/dojo.js" djConfig="isDebug: true"></script>
|
|
|
10 |
<!--<script type="text/javascript" src="../vml.js"></script>-->
|
|
|
11 |
<!--<script type="text/javascript" src="../svg.js"></script>-->
|
|
|
12 |
<!--<script type="text/javascript" src="../silverlight.js"></script>-->
|
|
|
13 |
<script type="text/javascript">
|
|
|
14 |
dojo.require("dojox.gfx");
|
|
|
15 |
|
|
|
16 |
var grid_size = 500, grid_step = 50;
|
|
|
17 |
var main = null, g = null, image = null, rect = null;
|
|
|
18 |
|
|
|
19 |
makeShapes = function(){
|
|
|
20 |
var s = dojox.gfx.createSurface("test", 800, 600);
|
|
|
21 |
for(var i = 0; i <= grid_size; i += grid_step){
|
|
|
22 |
s.createLine({x1: 0, x2: grid_size, y1: i, y2: i}).setStroke("black");
|
|
|
23 |
s.createLine({y1: 0, y2: grid_size, x1: i, x2: i}).setStroke("black");
|
|
|
24 |
}
|
|
|
25 |
|
|
|
26 |
main = s.createGroup();
|
|
|
27 |
//rect = main.createRect({x: 0, y: 0, width: 100, height: 100}).setStroke("black").setFill(new dojo.Color([255, 0, 255, 0.5]));
|
|
|
28 |
image = main.createImage({width: 157, height: 53, src: "http://archive.dojotoolkit.org/nightly/checkout/util/resources/dojotoolkit.org/mini-dtk/images/logo.png"});
|
|
|
29 |
// comment out the next string to see the problem
|
|
|
30 |
rect = main.createRect({x: 0, y: 0, width: 100, height: 100}).setStroke("black").setFill(new dojo.Color([255, 0, 255, 0.5]));
|
|
|
31 |
//g = main.createGroup();
|
|
|
32 |
//g.createRect({x: 0, y: 0, width: 100, height: 100}).setStroke("black").setFill(new dojo.Color([255, 255, 0, 0.5]));
|
|
|
33 |
};
|
|
|
34 |
|
|
|
35 |
trans = function(){
|
|
|
36 |
var x = 1;
|
|
|
37 |
main.setTransform([dojox.gfx.matrix.rotategAt(45, 200, 200), {dx: 200, dy: 200}]);
|
|
|
38 |
};
|
|
|
39 |
|
|
|
40 |
dojo.addOnLoad(makeShapes);
|
|
|
41 |
|
|
|
42 |
</script>
|
|
|
43 |
</head>
|
|
|
44 |
<body>
|
|
|
45 |
<p>Testing image:<br /><button onclick="trans();">Trans</button></p>
|
|
|
46 |
<p>Note: Silverlight doesn't allow downloading images when run from a file system. This demo should be run from a server.</p>
|
|
|
47 |
<div id="test"></div>
|
|
|
48 |
<p>That's all Folks!</p>
|
|
|
49 |
</body>
|
|
|
50 |
</html>
|