mobile-graphic-easel-src-easeljs-display-Bitmap.js / js
A Bitmap represents an Image, Canvas, or Video in the display list. A Bitmap can be instantiated using an existing HTML element, or a string. <h4>Example</h4> var bitmap = new createjs.Bitmap("imagePath.jpg"); Note: When a string path or image tag that is not yet loaded is used, the stage may need to be redrawn before it will be displayed. @class Bitmap @extends DisplayObject @constructor
parameter: {Image | HTMLCanvasElement | HTMLVideoElement | String} imageOrUri The source object or URI to an image to display. This can be either an Image, Canvas, or Video object, or a string URI to an image file to load and use. If it is a URI, a new Image object will be constructed and assigned to the .image property.
The image to render. This can be an Image, a Canvas, or a Video. @property image @type Image | HTMLCanvasElement | HTMLVideoElement
Whether or not the Bitmap should be draw to the canvas at whole pixel coordinates. @property snapToPixel @type Boolean @default true
Specifies an area of the source image to draw. If omitted, the whole image will be drawn. @property sourceRect @type Rectangle @default null
@property DisplayObject_initialize @type Function @private
Initialization method. @method initialize @protected
Returns true or false indicating whether the display object would be visible if drawn to a canvas. This does not account for whether it would be visible within the boundaries of the stage. NOTE: This method is mainly for internal use, though it may be useful for advanced uses. @method isVisible
returns: {Boolean} Boolean indicating whether the display object would be visible if drawn to a canvas
@property DisplayObject_draw @type Function @private
Draws the display object into the specified context ignoring it's visible, alpha, shadow, and transform. Returns true if the draw was handled (useful for overriding functionality). NOTE: This method is mainly for internal use, though it may be useful for advanced uses. @method draw
parameter: {CanvasRenderingContext2D} ctx The canvas 2D context object to draw into.
parameter: {Boolean} ignoreCache Indicates whether the draw operation should ignore any current cache. For example, used for drawing the cache (to prevent it from simply drawing an existing cache back into itself).
Because the content of a Bitmap is already in a simple format, cache is unnecessary for Bitmap instances. You should <b>not</b> cache Bitmap instances as it can degrade performance. <strong>However: If you want to use a filter on a Bitmap, you <em>MUST</em> cache it, or it will not work.</strong> To see the API for caching, please visit the DisplayObject {{#crossLink "DisplayObject/cache"}}{{/crossLink}} method. @method cache
Because the content of a Bitmap is already in a simple format, cache is unnecessary for Bitmap instances. You should <b>not</b> cache Bitmap instances as it can degrade performance. <strong>However: If you want to use a filter on a Bitmap, you <em>MUST</em> cache it, or it will not work.</strong> To see the API for caching, please visit the DisplayObject {{#crossLink "DisplayObject/cache"}}{{/crossLink}} method. @method updateCache
Because the content of a Bitmap is already in a simple format, cache is unnecessary for Bitmap instances. You should <b>not</b> cache Bitmap instances as it can degrade performance. <strong>However: If you want to use a filter on a Bitmap, you <em>MUST</em> cache it, or it will not work.</strong> To see the API for caching, please visit the DisplayObject {{#crossLink "DisplayObject/cache"}}{{/crossLink}} method. @method uncache
Returns a clone of the Bitmap instance. @method clone
returns: {Bitmap} a clone of the Bitmap instance.
Returns a string representation of this object. @method toString
returns: {String} a string representation of the instance.
(C) Æliens 04/09/2009
You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.