admin管理员组文章数量:1327849
Canvas can draw text but it cannot create input textfield. This would mean one have to do it in html but then how can you be sure to position that textfield exactly where you want ?
I want to be able to do this programmatically at runtime.
Canvas can draw text but it cannot create input textfield. This would mean one have to do it in html but then how can you be sure to position that textfield exactly where you want ?
I want to be able to do this programmatically at runtime.
Share Improve this question edited Mar 19, 2012 at 23:45 user310291 asked Mar 19, 2012 at 21:34 user310291user310291 38.2k88 gold badges294 silver badges518 bronze badges1 Answer
Reset to default 7Create following HTML structure to place inputbox on canvas.
<div id="container" style="width:500px; height:500px; position:relative;">
<canvas id="drawing-surface" width="500px" height="500px"></canvas>
<input type="text" style="position:absolute; left=?; top=?;" />
</div>
Hope this solves your problem. Replace left=?
and top=?
with appropriate positions.
本文标签: javascriptCreating Input TextField at precise position on CanvasStack Overflow
版权声明:本文标题:javascript - Creating Input TextField at precise position on Canvas? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742219045a2435102.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论