Photoshop CS2
Adobe Photoshop CS2 Scripting Guide
Scripting Photoshop CS2 79
●
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 will 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.
Note:
See
‘Photoshop CS2’s Object Model’ on page 8
for information on selection objects and
other Photoshop CS2 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.
●
theDocHeightInPixels
indicates the bottom row in the document; that is row whose coordinate
is the total number of rows in the document.
Note:
The value of
theDocHeightInPixels
is the total number of pixels that determine the vertical
dimension of the document. Rows are stacked vertically.
●
Lower left corner:
theDocWidthInPixels / 2, 0
●
theDocWidthInPixels / 2
●
0
●
Upper left corner of the selection:
0,0
AS
➤
To select an area and apply a wave filter to it:
1. Type the following code into the script file
HelloWorldDoc
just above the commented statements that
restore original preferences:
--create new variables to contain the document object’s width and height
--determine width and height values by multiplying the
--width and height in inches by the resolution
--(which equals the number of pixels per inch)
Содержание PHOTOSHOP CS 2.0 - SCRIPTING GUIDE
Страница 1: ...bbc Adobe Photoshop cs 2 Scripting Guide ...