-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.html
34 lines (30 loc) · 1.08 KB
/
demo.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
34
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<link rel="stylesheet" type="text/css" href="css/imageEditor.css"/>
<title>ImageEditor</title>
</head>
<body>
<input type="file" id="image"></input>
<script type="text/javascript" src="js/jquery.1.8.1.min.js"></script>
<script type="text/javascript" src="js/imageEditor.js"></script>
<script type="text/javascript">
var editor = null;
$('#image').on('change',function(e){
var imageFile = e.target.files[0];
var src = window.URL.createObjectURL(imageFile);
var editorConfig = {
url:src, //原图url || dataUrl
degree:-90, //默认旋转角度
lineWeight:[5,10,15], //马赛克画笔
};
if(!editor){
editor = new ImageEditor(editorConfig);
}else{
editor.resetImgItem(editorConfig);
}
});
</script>
</body>
</html>