오윤석

gif 생성 example

...@@ -63,6 +63,30 @@ ...@@ -63,6 +63,30 @@
63 setTimeout(function () { 63 setTimeout(function () {
64 gifGenerator = new GifGenerator(imageEditor._graphics.getCanvas()); 64 gifGenerator = new GifGenerator(imageEditor._graphics.getCanvas());
65 }, 1000); 65 }, 1000);
66 + function render() {
67 + gifGenerator.make().then(
68 + (blob) => {
69 + window.open(window.URL.createObjectURL(blob));
70 + },
71 + (error) => {
72 + alert(error);
73 + }
74 + );
75 + }
66 </script> 76 </script>
77 + <button
78 + style="
79 + position: absolute;
80 + top: 70px;
81 + right: 70px;
82 + border: 1px solid #fff;
83 + background: rgba(0, 0, 0, 0);
84 + color: #fff;
85 + padding: 10px 20px;
86 + "
87 + onClick="render();"
88 + >
89 + GIF 생성
90 + </button>
67 </body> 91 </body>
68 </html> 92 </html>
......