git-svn-id: https://msi/svn/firstRepo/Management/trunk@8 0f545695-f87b-41b6-9a03-7f16563b5454
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<title>HTML5 camera test</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
</head>
|
||||
<body>
|
||||
<form>
|
||||
<input id="file-input" type="file" name="image" accept="image/*" capture />
|
||||
<input id="file-input" type="file" name="image" accept="image/*" />
|
||||
</form>
|
||||
<pre id="output"></pre>
|
||||
|
||||
<script>
|
||||
var input = document.getElementById("file-input");
|
||||
input.addEventListener("change", function(event) {
|
||||
var file = input.files[0],
|
||||
img = new Image(),
|
||||
reader = new FileReader();
|
||||
|
||||
document.getElementById("output").innerHTML =
|
||||
file.name + "\n" +
|
||||
file.type + "\n" +
|
||||
file.size + " bytes\n";
|
||||
|
||||
reader.onload = function(event) {
|
||||
var img = new Image();
|
||||
img.width = 300;
|
||||
img.src = event.target.result;
|
||||
document.body.appendChild(img);
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
}, false);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user