-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.html
33 lines (33 loc) · 1.44 KB
/
example.html
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
<!DOCTYPE html>
<html>
<head>
<title>Example using jPolygon</title>
<meta charset="UTF-8">
<meta name="description" content="An example using polygon">
<meta name="keywords" content="HTML,CSS,JavaScript,polygon">
<meta name="author" content="Joseph Dung">
</head>
<body onload="clear_canvas()">
<div style="float:left">
<canvas id="polygon" width="640" height="480" style="cursor:crosshair" data-imgsrc="truck.jpg" onmousedown="point_it(event)" 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>
<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><b>Go to: </b><a href="https://github.com/kod3r">project and source code</a></p>
</div>
</div>
<script type="text/javascript" src="polygon.js"></script>
</body>
</html>