beautypg.com

Adobe Flash Professional CC 2014 v.13.0 User Manual

Page 871

background image

To the top

To the top

Flash Lite bitmap and vector graphics in mobile devices

Flash Lite can render both vector and bitmap graphics. Each type of graphic has its advantages and disadvantages. The decision to use vector
rather than bitmap graphics is not always clear and often depends on several factors.

Vector graphics are compactly represented in SWF files as mathematical equations and rendered at run time by the Flash Lite player. In contrast,
bitmap graphics are represented as arrays of picture elements (pixels), which require more bytes of data. Therefore, using vector graphics in a file
can help reduce file size and memory usage.

Vector graphics also maintain their smooth shapes when scaled in size. Bitmap images can appear boxy, or pixelated, when scaled.

Compared to bitmaps, vector graphics require more processing power to render, especially vector graphics that have many complex shapes and
fills. Consequently, heavy use of vector shapes can sometimes reduce overall file performance. Because bitmap graphics do not require as much
processing time to render as vector graphics, they are better choice for some files, for example, a complex road map meant to be animated and
scrolled on a mobile phone.

Keep these considerations in mind:

Avoid using outlines on vector shapes. Outlines have an inner and outer edge (fills have only one) and are twice the work to render.

Corners are simpler to render than curves. When possible, use flat edges, especially with very small vector shapes.

Optimization is especially helpful with small vector shapes such as icons. Complex icons may lose their details upon rendering, and the work
of rendering the details is wasted.

As a general rule, use bitmaps for small, complex images (such as icons) and vector graphics for larger and simpler ones.

Import bitmap graphics at the correct size; don’t import large graphics and scale them down in Flash, because this wastes file size and
run-time memory.

The Flash Lite player does not support bitmap smoothing. If a bitmap is scaled or rotated, it will have a chunky appearance. If it is necessary
to scale or rotate a graphic, consider using a vector graphic instead.

Text is essentially just a very complex vector shape. Of course, text is often critical, so it can rarely be avoided entirely. When text is needed,
avoid animating it or placing it over an animation. Consider using text as a bitmap. For multiline dynamic and input text, the line break of the
text string is not cached. Flash breaks lines at run time and recalculates the breaks every time the text field needs to be redrawn. Static text
fields are not problematic, because the line breaking is precalculated at compile time. For dynamic content, using dynamic text fields is
unavoidable, but when possible, consider using static text fields instead.

Minimize the use of transparency in PNG files; Flash must calculate redraws even for the transparent portions of the bitmap. For example,
with a transparent PNG file that represents a foreground element, don't export the transparent PNG at the full size of the screen. Instead,
export it at the actual size of the foreground element.

Try to group bitmap layers together and vector layers together. Flash needs to implement different renderers for bitmap and vector content,
and switching between renderers takes time.

For more tips and techniques for creating content for mobile phones and devices, see

www.adobe.com/go/learn_cs_mobilewiki_en

.

Set compression of Flash Lite bitmaps for mobile devices

When using bitmaps, you can set image-compression options (on a per-image basis or globally for all bitmap images) that reduce SWF file size.

Set compression options for an individual bitmap file

1. Start Flash and create a document.

2. Select a bitmap in the Library window.

3. Right-click (Windows) or Control-click (Macintosh) the bitmap icon in the Library window, and select Properties from the context menu to

open the Bitmap Properties dialog box.

4. In the Compression pop-up menu, select one of the following options:

Select the Photo (JPEG) option for images with complex color or tonal variations, such as photographs or images with gradient fills. This
option produces a JPEG file. Select the Use Imported JPEG Data check box to use the default compression quality specified for the
imported image. To specify a new quality compression setting, deselect Use Imported JPEG Data and enter a value between 1 and 100
in the Quality text box. A higher setting produces an image of higher image, but also a larger file, so adjust the value accordingly.

Select the Lossless (PNG/GIF) option for images with simple shapes and a few colors. This option compresses the image using lossless
compression, which discards no data.

5. Click Test to determine the results of the file compression.

Compare the original file size to the compressed file size to decide whether the selected compression setting is acceptable.

Set compression for all bitmap images

864