Chromium Code Reviews

Side by Side Diff: polymer_0.4.0/bower_components/gif.js/site/contents/code.md

Issue 786953007: npm_modules: Fork bower_components into Polymer 0.4.0 and 0.5.0 versions (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
1 1
2 ```javascript 2 ```javascript
3 var gif = new GIF({ 3 var gif = new GIF({
4 workers: 2, 4 workers: 2,
5 quality: 10 5 quality: 10
6 }); 6 });
7 7
8 // add a image element 8 // add a image element
9 gif.addFrame(imageElement); 9 gif.addFrame(imageElement);
10 10
11 // or a canvas element 11 // or a canvas element
12 gif.addFrame(canvasElement, {delay: 200}); 12 gif.addFrame(canvasElement, {delay: 200});
13 13
14 // or copy the pixels from a canvas context 14 // or copy the pixels from a canvas context
15 gif.addFrame(ctx, {copy: true}); 15 gif.addFrame(ctx, {copy: true});
16 16
17 gif.on('finished', function(blob) { 17 gif.on('finished', function(blob) {
18 window.open(URL.createObjectURL(blob)); 18 window.open(URL.createObjectURL(blob));
19 }); 19 });
20 20
21 gif.render(); 21 gif.render();
22 22
23 ``` 23 ```
OLDNEW

Powered by Google App Engine