Recipe 6.2. Editing Bitmaps


Problem

You want to edit an imported bitmap, including erasing and painting over bitmaps or using bitmaps as fills.

Solution

Use Modify Break Apart.

Discussion

When you drag an imported bitmap instance into a Flash movie, it is locked for editing. If you select it with the Selection tool, it has a gray bounding box around it, and all you can do is reposition or scale the bitmap.

You can edit a bitmap, however. To do so, you must break it apart using Modify Break Apart. Breaking apart a bitmap makes the pixels accessible for editing. More specifically, once it is broken apart, you can erase portions of a bitmap, or paint over them using a tool, such as the Brush tool.

Broken-apart bitmap pixels behave like the pixels of a vector shape's fill. If layered over another vector shape in the same layer, bitmap pixels remove any portion of a fill beneath them; before a bitmap is broken apart, it obscures, but does not remove, any vector shape fills beneath it in the same layer.

Breaking apart a bitmap graphic has no implications with regard to file size. That is, all the following movies using the same bitmap, image.jpg, would yield .swf files with the same file size:

  • One instance of image.jpg, not broken apart

  • Ten instances of image.jpg, not broken apart

  • Ten instances of image.jpg, broken apart

An imported bitmap is stored in the library, and if it is used once on the stage, in any way, it must be downloaded in its entirety once. This rule applies even to bitmaps that are placed only partially on the stage, as well as to bitmaps that have been partially erased, masked, or resized.

In addition to enabling you to use Flash drawing and selection tools on pixels, breaking apart a bitmap also makes it easier to use a bitmap as a shape's fill. These techniques are discussed in Recipe 6.3.

See Also

Recipe 6.1, Recipe 6.3




Flash 8 Cookbook
Flash 8 Cookbook (Cookbooks (OReilly))
ISBN: 0596102402
EAN: 2147483647
Year: 2007
Pages: 336
Authors: Joey Lott

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net