-
Notifications
You must be signed in to change notification settings - Fork 1
/
imgareaselect.php
executable file
·28 lines (28 loc) · 1.12 KB
/
imgareaselect.php
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
<link rel="stylesheet" type="text/css" href="imgareaselect/css/imgareaselect-default.css" />
<script type="text/javascript" src="script/jquery.js"></script>
<script type="text/javascript" src="imgareaselect/scripts/jquery.imgareaselect.pack.js"></script>
<script type="text/javascript">
var xcrop = null, ycrop = null, wcrop = null, hcrop = null;
function selectEnd(obj, state) {
if (xcrop == null) {
xcrop = document.getElementById("xcrop");
ycrop = document.getElementById("ycrop");
wcrop = document.getElementById("wcrop");
hcrop = document.getElementById("hcrop");
}
xcrop.value = state.x1;
ycrop.value = state.y1;
wcrop.value = state.width;
hcrop.value = state.height;
}
function start_designer() {
$('img#photo').imgAreaSelect({
x1: 0, y1: 0, x2: 154, y2: 96,
minWidth: 154, minHeight: 96,
aspectRatio: '154:96',
handles: true,
onSelectChange: selectEnd
});
}
</script>
<img id="photo" src="images/defcrop.png" alt="Image Crop" />