Ibm Worklight - Using Canvas
I want to add canvas to my Worklight project. I learned how to create canvas from this tutorial: http://dev.opera.com/articles/view/html5-canvas-painting/ I tried to add the markup
Solution 1:
I didn't try with jQuery Mobile (as your code snippet implies...), but the following worked for me while previewing in Worklight Console:
Added to common\js a new
canvas.js
containing the code from here: http://pastebin.com/cd5wxJunAdded to the HEAD element in the .html file:
<scriptsrc="js/canvas.js"></script><styletype="text/css">#container { position: relative; } #imageView { border: 1px solid #000; } #imageTemp { position: absolute; top: 1px; left: 1px; } </style>
Added to the body element in the .html file:
<p><label>Drawing tool: <selectid="dtool"><optionvalue="line">Line</option><optionvalue="rect">Rectangle</option><optionvalue="pencil">Pencil</option></select></label></p><divid="container"><canvasid="imageView"width="400"height="300"></canvas></div>
Build All and Deploy
- Preview in Worklight Console
Post a Comment for "Ibm Worklight - Using Canvas"