Complementing the vector graphics API described in Chapter 35, "Programming Vector Graphics," Flash Player has an easy-to-use bitmap graphics API. Bitmap graphics are composed of pixels instead of strokes and fills. They are a direct way to work with on-screen graphics. Just as having direct access to binary data opens a whole set of possibilities, direct access to the pixels on-screen means you can display anything you can imagine, or at least anything you can figure out how to code.
Draw bitmap graphics in Flash Player with two classes:
BitmapData class stores image data, but by itself,
BitmapData doesn't display anything. The
Bitmap class is a
DisplayObject that displays the contents of the
BitmapData object associated with it. In other words,
BitmapData is the model and
Bitmap is the view; you need a
Bitmap to display a
In this chapter you'll see many applications of the bitmap drawing API from the mundane to the magical as you learn how to use the
A bitmap is the simplest and most literal representation of an image. Bitmaps store the color of every pixel in the image. They usually do this in some sort of two-dimensional array, so you can access the color of a given pixel by its location in the matrix. Bitmaps in Flash Player store one 32-bit integer value ...