Sarthak Singhal
by Sarthak Singhal

Created

15 October 2008

Adobe Fireworks CS4 has taken the 9-slice scaling functionality in Fireworks CS3 to the next level by making it possible for you to perform 9-slice scaling on any selection without first having to convert it to a symbol to enable the tool.
 
This article explains how 9-slice scaling works and how you can use this new transform tool in the context of different objects or even a combination of objects.
 

 
Limitations of intelligent scaling Fireworks CS3

The 9-slice scaling feature that was introduced in Fireworks CS3 allowed you to retain the shape of symbol objects in specific regions (depending on 9-slice guides adjustments) even while transforming them.
 
Before the days of Fireworks CS3, whenever an object, vector, or bitmap was scaled, it would get distorted. Such distortion was clearly visible when scaling the rounded corners of a rectangle, for example. The introduction of 9-slice scaling in Fireworks CS3 made it possible for you to scale smooth, rounded corners without distorting them. This functionality was not limited to vector objects but extended to bitmap objects as well. When you applied the 9-slice scaling to a bitmap object, the defined region got scaled without distorting the other areas in the bitmap. This helped application designers take screen shots of the panels and dialog boxes in their existing application and then extend them.
 
However, 9-slice had limited functionality in Fireworks CS3. It made you convert objects into symbols, whether or not you would be reusing them. This resulted in unnecessary complexity when you entered symbol edit mode to make even minor changes like adding a simple stroke.
 

 
Intelligent scaling in Fireworks CS4

In order to simplify the process of intelligent scaling, Fireworks CS4 has introduced a new transformation tool: the 9-slice scaling tool. You can easily reach this tool under the scale toolset drop-down in the "Select" subsection of the Tools palette (see Figure 1).
 
Location of the 9-slice scaling tool
Figure 1. Location of the 9-slice scaling tool
 
This tool is a real timesaver for designers who wish to scale bitmap images on the canvas without distorting their appearance. This is because you can now scale a selection with the 9-slice scaling tool without first converting it into a symbol. Also, since the tool is available on the canvas, you can do any further editing directly on the canvas without entering the symbol edit mode as in Fireworks CS3. This not only saves you time but also helps you stay focused on your project.
 
The 9-slice scaling tool works on bitmap, vector, text, and grouped objects. However, it doesn't work on symbols. Symbols follow the Fireworks CS3 workflow of 9-slice scaling. You can use this tool also inside the symbol edit mode. The tool is of great help when you want to scale objects individually without reflecting the changes in multiple places.
 

 
Placing guides on an object selection

This is how the 9-slice scaling tool works in Fireworks CS4. You must first place the guides on a selection (see Figure 2). When you stretch the image horizontally only the area marked in orange gets scaled. The area on the left and right of this orange zone is not affected. Vertical scaling modifies only the area marked in purple. The panels above and below this region are unchanged.
 
Original image with 9-slice guides on it
Figure 2. Original image with 9-slice guides on it
 

 
Applying the 9-slice scaling tool to bitmap objects

When you select a bitmap object to which you want to apply this tool, the default guides appear at 25% from four directions. After setting the guides on the image, you can scale it horizontally without distorting it (see Figure 3).
 
Image with default guide settings (top left), guides set for horizontal scaling (top right), and an undistorted image after horizontal scaling (bottom)
Figure 3. Image with default guide settings (top left), guides set for horizontal scaling (top right), and an undistorted image after horizontal scaling (bottom)
 
If you want to resize the scaled object further, first close the tool. Now reactivate it on the scaled bitmap. This resets the guide at its default settings. Because the guide settings are not remembered from when you last used the tool, you can use the tool for continual, independent scaling of objects. Rescale the image again, in a vertical direction this time, without distorting it (see Figure 4).
 
Image with default guide settings (top), guides set for vertical scaling (middle), and an undistorted image after vertical scaling (bottom)
Figure 4. Image with default guide settings (top), guides set for vertical scaling (middle), and an undistorted image after vertical scaling (bottom)
 
When you apply the guides to a rounded rectangle in Fireworks CS4, the 9-slice scaling tool preserves the roundness of the final scaled image (see Figure 5).
 
Rounded rectangle with guides set for horizontal scaling (top) and undistorted rounded corners after horizontal scaling (bottom)
Figure 5. Rounded rectangle with guides set for horizontal scaling (top) and undistorted rounded corners after horizontal scaling (bottom)
 
If the selected rectangle has relative roundness (defined as a percentage), the attribute changes to an absolute value (expressed in pixels) upon scaling. This prevents the rounded corners of the rectangle from becoming distorted during the scaling (see Figure 6). The 9-slice scaling tool also allows you to convert relative roundness to an absolute value, and vice versa, after scaling.
 
Scaling a rounded rectangle horizontally without the 9-slice scaling tool
Figure 6. Scaling a rounded rectangle horizontally without the 9-slice scaling tool

 
Applying the 9-slice scaling tool to vector objects

You can use the 9-slice scaling tool on vector objects just as you can on bitmap objects. Scaling a vector object divides it into multiple regions depending on how you place the guides. This adds new vector points to the edges of the object (see Figure 7).
 
Placing guides on a vector object (top), which adds vector points along the edge of the object (bottom)
Figure 7. Placing guides on a vector object (top), which adds vector points along the edge of the object (bottom)
 
When you apply the the 9-slice scaling tool to text objects, point text is converted to area text. In case the object is already an area text, the bounding box just increases with the scaled object.
 
Note: Point text (auto-expand) is where the bounding box grows automatically to accommodate the text block as you type. Area text is where you can expand the text bounding box and allow the text to wrap within the expanding box.
 

 
Applying the 9-slice scaling tool to a combination of objects

Here's an example of how to use the 9-slice scaling tool on a combination of objects. Consider a situation in which you have an editable PNG file comprising of bitmap, vector, and text objects. If you try to scaling the file without using the 9-slice scaling tool, the file components will get distorted (see Figure 8).
 
Original composite image before scaling (top) and distorted (right) without the use of the 9-slice scaling tool
Figure 8. Original composite image before scaling (top) and distorted (right) without the use of the 9-slice scaling tool
 
If you apply the 9-slice scaling tool to the file, the default guides appear as shown in Figure 9 (top). You must adjust the guides per the bottom of Figure 9. If you now scale all the selected components horizontally, the objects on the canvas will get scaled without suffering any distortion.
 
Composite image with default 9-slice scaling guide settings (top) and adjusted guides set for horizontal scaling (bottom)
Figure 9. Composite image with default 9-slice scaling guide settings (top) and adjusted guides set for horizontal scaling (bottom)
 
After scaling the image horizontally, you can see that the bitmap and vector objects have been scaled intelligently and the text objects have not been distorted (see Figure 10). Upon 9-slice scaling, text objects are converted from point text to area text. The bitmap components in the background are preserved without distorting the central areas of focus (photographer and sun).
 
Composite image after 9-slice scaling
Figure 10 . Composite image after 9-slice scaling
 

 
Where to go from here

The 9-slice scaling tool is of great use to designers. To learn more about Fireworks CS4, visit my Fireworks blog. You can also read my article, Enhancing rich symbols in Fireworks CS3, in the Fireworks Developer Center and explore some of my Fireworks extensions in the Fireworks Exchange.
 

Requirements

Prerequisite knowledge

This article assumes that you have knowledge of the Fireworks workspace layout and also some familiarity working with different transformation tools that exist within the application, including the 9-slice symbol graphics scaling functionality in Fireworks CS3.

User level

Beginning