This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Example JavaScript code to demonstrate how to compose classes. | |
| * This requires ES6 syntax. | |
| * | |
| * `Transportation` is a base class that is intended to have classes derived from it. | |
| * Derived classes are expected to manage the base class properties and add their own. | |
| * In each constructor, `super` is called first to allow the base class to perform its state | |
| * initialization before the derived class do its, allowing the derived class to override | |
| * anything done in the base class constructor. | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function saveCanvasThumbnail( scale ){ | |
| if( scale === undefined ) scale = .3; | |
| var canvas = getElementById( 'canvas' ); | |
| var bitmap = new createjs.Bitmap( canvas ); | |
| bitmap.cache( 0, 0, canvas.width, canvas.height, scale ); | |
| var base64 = bitmap.getCacheDataURL(); |