The Bitmap object represents display objects that represent bitmap images. These can be images that you create with the Loader object or Bitmap() constructor.

The Bitmap() constructor allows you to create a Bitmap object that contains a reference to a BitmapData object. After you create a Bitmap object, use the addChild() or addChildAt() method of the parent DisplayObjectContainer instance to place the bitmap on the display list.

A Bitmap object can share its BitmapData reference among several Bitmap objects, independent of translation or rotation properties. Because you can create multiple Bitmap objects that reference the same BitmapData object, multiple display objects can use the same complex BitmapData object without incurring the memory overhead of a BitmapData object for each display object instance.

If you would prefer to perform a batch rendering command, rather than using a single surface for each Bitmap object, you can also draw to the screen using the drawTiles() or drawTriangles() methods which are available to Lib.Media.Display.Tilesheet objects.

Note: The Bitmap object is not a subclass of the InteractiveObject class, so it cannot dispatch mouse events. However, you can use the addEventListener() method of the display object container that contains the Bitmap object.


Bitmap object inherited from DisplayObject -> EventDispatcher


Can be created using new method:

Lib.Media.Display.Bitmap.new(bitmapData, pixelSnapping, smoothing)

creates bitmap object

bitmapData - The BitmapData object being referenced. Default nil.

pixelSnapping - Controls whether or not the Bitmap object is snapped to the nearest pixel. The PixelSnapping object includes possible values:

PixelSnapping.NEVER - No pixel snapping occurs.

PixelSnapping.ALWAYS - The image is always snapped to the nearest pixel, independent of transformation.

PixelSnapping.AUTO - The image is snapped to the nearest pixel if it is drawn with no rotation or skew and it is drawn at a scale factor of 99.9% to 100.1%. If these conditions are satisfied, the bitmap image is drawn at 100% scale, snapped to the nearest pixel. Default nil.

smoothing - Controls whether or not the bitmap is smoothed when scaled. If true, the bitmap is smoothed when scaled. If false, the bitmap is not smoothed when scaled. Default false.


Created Bitmap object has properties:

bitmapData

The BitmapData object being referenced.


smoothing

Controls whether or not the bitmap is smoothed when scaled.

true/false


Created with the Personal Edition of HelpNDoc: Write EPub books for the iPad