javascript - A simple drawing program -
i need draw circle , rectangular on picture on webpage,
for this, found out programs , open source projects, zwibbler, literally canvas
however, lack of features
i need take coordinates of drawn circles , rectangulars
i couldn't find application operation.
if know , comment glad
thanks in advance
take code, paste in html file, run browser, , see happens, not going explain it, please take @ documentation of zwibbler, see here taken there.
<html> <body> <script src="http://zwibbler.com/zwibbler-demo.js"></script> <div id="zwibbler1" style="width:800px;height:500px"></div> <script> var ctx = zwibbler.create("zwibbler1", {}); ctx.on('document-changed', function() { var firstselectednode = ctx.getselectednodes()[0]; if (!firstselectednode) return; var bounds = ctx.getnoderectangle(firstselectednode) document.getelementbyid('position').innerhtml = `x: ${bounds.x}, y: ${bounds.y}` }); </script> <br> <h1>position of current node: <span id="position"><span></h1> </body> </html>
Comments
Post a Comment