forked from matteomattei/jPolygon
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.html
More file actions
41 lines (41 loc) · 1.97 KB
/
example.html
File metadata and controls
41 lines (41 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html>
<html>
<head>
<title>Example using jPolygon</title>
<meta charset="UTF-8">
<meta name="description" content="An example using jPolygon">
<meta name="keywords" content="HTML,CSS,JavaScript,jPolygon">
<meta name="author" content="Matteo Mattei">
</head>
<body onload="clear_canvas()">
<div style="float:left">
<canvas id="jPolygon" style="cursor:crosshair" data-imgsrc="image.jpg" onmousedown="press(event)" onmousemove="move(event)" onmouseup="release()" oncontextmenu="return false;">
Your browser does not support the HTML5 canvas tag.
</canvas>
</div>
<div style="float:left; margin-left:20px;">
<div>
<button onclick="undo()">Undo</button>
<button onclick="clear_canvas()">Clear</button>
<select id="tool"><option value="rect">Rectangle</option><option value="polygon">Polygon</option></select>
<p>Press <strong>Left Click</strong> to draw a point.</p>
<p><strong>CTRL+Click</strong> or <strong>Right Click</strong> to close the polygon.</p>
</div>
<div>
<p><strong>Coordinates:</strong></p>
<textarea id="coordinates" disabled="disabled" style="width:300px; height:200px;"></textarea>
</div>
<div>
<p><strong>Frames completed:</strong></p>
<textarea id="frames" disabled="disabled" style="width:300px; height:20px;"></textarea><br>
<button onclick="validate_frame()">Validate</button>
<button onclick="pop_frame()">Pop</button>
<button onclick="clear_all_frame()">Clear all</button>
</div>
<div>
<a href="https://github.com/jeanphilippegoldman/jPolygon">source code</a></p>
</div>
</div>
<script type="text/javascript" src="jPolygon.js"></script>
</body>
</html>