Adobe Smoke Alarm CS3 Manual De Usuario

Descargar
Página de 85
Photoshop CS3
Adobe Photoshop CS3  Scripting Guide
 Scripting Photoshop CS3     66
Note:
Look up the following classes in the Adobe Photoshop CS3 JavaScript Scripting Reference, or in the 
ExtendScript Object Model Viewer to see if you understand how you used them in this script:
SolidColor
 
ArtLayer
. Notice that the 
LayerKind.TEXT
 value of the kind property uses the 
LayerKind
 
constant. Constants are always depicted in upper case letters in Photoshop CS3 JavaScripts. 
Applying a Wave Filter
In this section we’ll apply a wave filter to the word Hello in our document. This entails the following steps: 
Set the document width and height to pixels and then rasterize the text object in the Text Layer. 
Note:
Because text is a vector graphic and cannot apply a wave filter to vector graphics, we must first 
convert the image to a bitmap. Rasterizing converts mathematically defined vector artwork to 
pixels. For more information on rasterizing, refer to Photoshop CS3 Help. 
Select the area of the layer to which we want to apply the wave filter. 
Note:
See 
 in order to understand the code within the script 
that accomplishes this task. 
Apply a wave filter to the selection. 
Note:
The wave is a truncated sine curve. 
Defining the Area of a Selection Object
To define the area of a selection object, we create an array of coordinates, or points specified in pixels 
within the document. The array indicates the coordinates that define the outside corners of a rectangular 
area that begins at the top left corner of the document and extends half way across the document. 
Note:
You can define any number of points for a selected area. The number of coordinates determines the 
shape of the selection. The last coordinate defined must be the same as the first so that the area is a 
closed selection path.
Note:
See 
 for information on selection objects and other 
Photoshop CS3 objects. 
The array values in order are: 
Upper left corner of the selection: 
0,0
 
0
 indicates the left-most column in the document.
0
 indicates the top row in the document.
Upper right corner of the selection: 
theDocWidthInPixels / 2, 0
theDocWidthInPixels / 2
 indicates the column in the middle of the document; that is, the 
column whose coordinate is the total number of columns in the document divided by 2.
Note:
The value of 
theDocWidthInPixels
 is the total number of pixels that defines the document’s 
horizontal dimension. Columns are arranged horizontally.
0
 indicates the top row in the document.
Lower right corner: 
theDocWidthInPixels / 2, theDocHeightInPixels
theDocWidthInPixels / 2 
indicates the middle of the document.