Debian Codegraph @

dojox/gfx/tests/svgweb/test_image2.html

raw symbols SCIP
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 <!-- SVGWEB { -->
6 <meta name="svg.render.forceflash" content="true"/>
7 <script src="svgweb/src/svg.js" data-path="svgweb/src"></script>
8 <script src="../../../../dojo/dojo.js" data-dojo-config="isDebug:true,forceGfxRenderer:'svg'" type="text/javascript"></script>
9 <!-- } -->
10 <script type="text/javascript">
11 dojo.require("dojox.gfx");
12
13 var grid_size = 500, grid_step = 50;
14 var main = null, g = null, image = null, rect = null;
15
16 makeShapes = function(){
17 var s = dojox.gfx.createSurface("test", 800, 600);
18 /* SVGWEB { */
19 s.whenLoaded(function() {
20 for(var i = 0; i <= grid_size; i += grid_step){
21 s.createLine({x1: 0, x2: grid_size, y1: i, y2: i}).setStroke("black");
22 s.createLine({y1: 0, y2: grid_size, x1: i, x2: i}).setStroke("black");
23 }
24
25 main = s.createGroup();
26 rect = main.createRect({x: 0, y: 0, width: 200, height: 200}).setStroke("black").setFill(new dojo.Color([255, 0, 255, 0.5]));
27 rect.connect("onclick", function(){ alert("rect"); })
28
29 image = s.createImage({width: 150, height: 100, src: "../images/eugene-sm.jpg"});
30 image.connect("onclick", function(){ alert("image"); })
31
32 main.add(image);
33 });
34 /* } */
35 };
36
37 trans = function(){
38 var x = 1;
39 main.setTransform([dojox.gfx.matrix.rotategAt(45, 200, 200), {dx: 200, dy: 200}]);
40 };
41
42 dojo.addOnLoad(makeShapes);
43
44 </script>
45 </head>
46 <body>
47 <p>Testing image:<br /><button onclick="trans();">Trans</button></p>
48 <p>Note: Silverlight doesn't allow downloading images when run from a file system. This demo should be run from a server.</p>
49 <div id="test"></div>
50 <p>That's all Folks!</p>
51 </body>
52 </html>