Chapter 2. External Image Capabilities

With Flash Player’s focused ability to readily handle vector drawing objects, it is often overlooked how capable the platform is at utilizing bitmap data through embedded or external image files. Whether using PNG, JPG, GIF, or the new JPEG-XR filetype, there is no denying that this imaging technology is extended and improved upon in some rather spectacular ways.

Enhanced High-Resolution Bitmap Support

Loaded BitmapData objects have historically been limited to 8,191 total pixels along any side with a total supported resolution of 16,777,215 pixels…which isn’t a whole lot when dealing with high resolution images. With the megapixel count of consumer digital cameras breaking well past 10, the need for greater resolution is easily apparent. With Flash Player 11, these restrictions have been lifted, making this is a feature that can be leveraged through a multitude of project types.

Note

1 megapixel is equal to 1,000,000 pixels.

Flash Player 10 supports up to 16.777 megapixels.

Flash Player 11 includes no such restrictions.

High-resolution bitmap

Figure 2-1. High-resolution bitmap

We don’t actually need to do anything to enable support for this behavior, as it is built into Flash Player itself. In the following example, we’ll use the Loader class to bring a high-resolution image into a Flash project:

package { import flash.display.Loader; import flash.display.Sprite; import flash.events.Event; ...

Get What's New in Flash Player 11 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.