-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathsobel.html
More file actions
50 lines (47 loc) · 1.18 KB
/
sobel.html
File metadata and controls
50 lines (47 loc) · 1.18 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
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html>
<head>
<title>Sobel - PicturElements</title>
<link rel="icon" href="pelement.png">
<link href="https://fonts.googleapis.com/css?family=Roboto:300,700" rel="stylesheet" type="text/css">
<style>
body{
background-color:white;
margin:0;
}
input{
display:block;
position:fixed;
}
#background{
display:block;
position:fixed;
width:100%;
height:100%;
background-size:contain;
}
</style>
<script>
function getImage(){
var file=evt.target.files;
if (!file[0].type.match('image.*')){
return 0; //end function
}
var reader=new FileReader();
/*reader.onload=function(){
document.getElementById("background").src=reader.
}*/
reader.onload = (function() {
return function(e) {
document.getElementById("background").src=e.target.result;
};
})(file);
reader.readAsDataURL(file);
}
</script>
</head>
<body>
<div id="background"></div>
<input type="file">Upload image</input>
</body>
</html>