Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function set_canvas_image(f, element) {
- let reader = new FileReader();
- // Closure to capture the file information.
- reader.onload = (function() {
- return function(e) {
- // Render thumbnail.
- element.src = e.target.result
- };
- })(f);
- // Read in the image file as a data URL.
- reader.readAsDataURL(f);
- }
Advertisement
Add Comment
Please, Sign In to add comment