
CHAPTER 4: User-Interface Tools Graphic customization objects 160
newPen()
controlObj.graphics.newPen( type, color, lineWidth);
type
The pen type, one of these constants:
ScriptUIGraphics.PenType.SOLID_COLOR
ScriptUIGraphics.PenType.THEME_COLOR
color
The pen color.
X If type is SOLID_COLOR, the color expressed as an array of three or four values,
in the form
[R, B, G, A] specifying the red, green, and blue values of the
color and, optionally, the opacity (alpha channel). All values are numbers in
the range [0.0...1.0]. An opacity of 0 is fully transparent, and an opacity of 1 is
fully opaque.
X If the type is THEME_COLOR, the name string of the theme. Theme colors are
defined by the host application.
lineWidth
The width in pixels of the line this pen will draw. The line is centered around the
current point. For example, if
lineWidth is 2, drawing a line from (0, 10) to (5, 10)
paints the two rows of pixels directly above and below y-position 10.
Creates a new drawing pen.
Returns a ScriptUIPen object
.
rectPath()
controlObj.graphics.rectPath (left, top[, width, height])
left, top
Defines the top left corner of the region, in the coordinate system of the control
that contains this graphics object.
width, height
The width and height of the region in pixels.
Defines a rectangular path in the currentPath
object, which can be filled using fillPath() or stroked
using strokePath()
.
Returns a Point
object for the upper left corner of the rectangle, which is the new currentPoint.
strokePath()
controlObj.graphics.fillPath (pen[, path])
pen
The ScriptUIPen object that defines the color and line width.
path
Optional, the ScriptUIPath object for the path. If not supplied, operates on the
currentPath
.
Strokes the path segments of a path with a given drawing pen.
Returns
undefined.
Comentários a estes Manuais