Draw polygon : Canvas Draw « Dojo toolkit « JavaScript DHTML






Draw polygon

 
<html>
  <head>
    <script type="text/javascript">
      var djConfig = {
        baseScriptUri : "js/dojo/",
        parseOnLoad : true
      };
    </script>
    <script type="text/javascript" src="js/dojo/dojo/dojo.js"></script>
    <script>
      dojo.require("dojox.gfx");
      function testIt() {
        var s = dojox.gfx.createSurface("my", 320, 240);
        s.createPolyline([ {x:160,y:15}, {x:10,y:5},{x:210,y:65}, {x:160,y:15} ]).setFill([255, 0, 0, 1]);
      }
    </script>
  </head>
  <body onLoad="testIt();">
        <div id="my"></div>
  </body>
</html>
       

   
  








Dojo-toolkit.zip( 3,849 k)

Related examples in the same category

1.Draw 3D ball
2.Draw line
3.Draw rectangle
4.Draw stroke
5.Draw text
6.Fill text
7.Shape rotation
8.Create Ellipse