Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating Input TextField at precise position on Canvas?

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.

like image 618
user310291 Avatar asked Mar 19 '12 21:03

user310291


1 Answers

Create 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.

like image 200
Software Enthusiastic Avatar answered Nov 14 '22 21:11

Software Enthusiastic