EaselJS

EaselJS  0.5.0

EaselJS > EaselJS > Bitmap
Search:
 
Filters

Class Bitmap - extends DisplayObject

A Bitmap represents an Image, Canvas, or Video in the display list.

Constructor

Bitmap ( imageOrUri )
Parameters:
imageOrUri <Image | HTMLCanvasElement | HTMLVideoElement | String> 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.

Properties

image - Image | HTMLCanvasElement | HTMLVideoElement

The image to render. This can be an Image, a Canvas, or a Video.

snapToPixel - Boolean

Whether or not the Bitmap should be draw to the canvas at whole pixel coordinates.
Default Value: true

sourceRect - Rectangle

Specifies an area of the source image to draw. If omitted, the whole image will be drawn.
Default Value: null

Methods

cache

void cache ( )
Because the content of a Bitmap is already in a simple format, cache is unnecessary for Bitmap instances. You should not cache Bitmap instances as it can degrade performance.
Returns: void

clone

Bitmap clone ( )
Returns a clone of the Bitmap instance.
Returns: Bitmap
a clone of the Bitmap instance.

draw

void draw ( ctx , ignoreCache )
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.
Parameters:
ctx <CanvasRenderingContext2D> The canvas 2D context object to draw into.
ignoreCache <Boolean> 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).
Returns: void

initialize

protected void initialize ( )
Initialization method.
Returns: void

isVisible

Boolean isVisible ( )
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.
Returns: Boolean
Boolean indicating whether the display object would be visible if drawn to a canvas

toString

String toString ( )
Returns a string representation of this object.
Returns: String
a string representation of the instance.

uncache

void uncache ( )
Because the content of a Bitmap is already in a simple format, cache is unnecessary for Bitmap instances. You should not cache Bitmap instances as it can degrade performance.
Returns: void

updateCache

void updateCache ( )
Because the content of a Bitmap is already in a simple format, cache is unnecessary for Bitmap instances. You should not cache Bitmap instances as it can degrade performance.
Returns: void