Fill text : Canvas Draw « Dojo toolkit « JavaScript Tutorial






<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);
        var txt = s.createText({x: 90, y: 130, text: "Text"});
        txt.setFont({family : "Times", size : "20pt", weight : "bold"});
        txt.setFill("yellow");
        txt.setStroke("red");
      }
    </script>
  </head>
  <body onLoad="testIt();">
        <div id="my"></div>
  </body>
</html>








29.87.Canvas Draw
29.87.1.Draw 3D ball
29.87.2.Draw line
29.87.3.Draw polygon
29.87.4.Draw rectangle
29.87.5.Draw stroke
29.87.6.Create Ellipse
29.87.7.Draw text
29.87.8.Fill text
29.87.9.Shape rotation