UNPKG

547 BHTMLView Raw
1<!DOCTYPE html>
2<html>
3 <head>
4 <title>Jimp browser example 2</title>
5 </head>
6 <body>
7
8 <h1> Demonstrates loading a relative file using Jimp on a WebWorker thread </h1>
9 <script>
10 var worker = new Worker("jimp-worker.js");
11 worker.onmessage = function (e) {
12 var img = document.createElement("img");
13 img.setAttribute("src", e.data);
14 document.body.appendChild(img);
15 };
16 worker.postMessage("lenna.png");
17 </script>
18
19 </body>
20</html>