test_fill.html 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" >
  2. <head>
  3. <title>Testing fill rule</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="../_base.js"></script>-->
  15. <!--<script type="text/javascript" src="../shape.js"></script>-->
  16. <!--<script type="text/javascript" src="../path.js"></script>-->
  17. <!--<script type="text/javascript" src="../vml.js"></script>-->
  18. <!--<script type="text/javascript" src="../svg.js"></script>-->
  19. <!--<script type="text/javascript" src="../silverlight.js"></script>-->
  20. <script type="text/javascript">
  21. dojo.require("dojox.gfx");
  22. makeShapes = function(){
  23. var surface = dojox.gfx.createSurface("test", 500, 500);
  24. var path = surface.createPath("");
  25. // form concentric circles
  26. var center = {x: 250, y: 250};
  27. for(var r = 200; r > 0; r -= 30){
  28. // make two 180 degree arcs to form a circle
  29. var start = {x: center.x, y: center.y - r};
  30. var end = {x: center.x, y: center.y + r};
  31. path.moveTo(start).arcTo(r, r, 0, true, true, end).arcTo(r, r, 0, true, true, start).closePath();
  32. }
  33. // set visual attributes
  34. path.setFill("red").setStroke("black");
  35. };
  36. dojo.addOnLoad(makeShapes);
  37. </script>
  38. </head>
  39. <body>
  40. <h1>Testing fill rule</h1>
  41. <div id="test" style="width: 500px; height: 500px;"></div>
  42. <p>That's all Folks!</p>
  43. </body>
  44. </html>