Adobe Photoshop CS5 Object Library JS: PathItem

Photoshop CS5

Class

PathItem

 A path or drawing object, such as the outline of a shape or a straight or curved line, which contains sub paths that comprise its geometry.

QuickLinks

add, deselect, duplicate, duplicate, fillPath, makeClippingPath, makeSelection, remove, removeAll, select, strokePath

Hierarchy

Object
PathItem

Properties

PropertyTypeAccessDescription
kindPathKind:
PathKind.NORMALPATH
PathKind.CLIPPINGPATH
PathKind.WORKPATH
PathKind.VECTORMASK
PathKind.TEXTMASK
r/wThe type of path.
namestring r/wThe name of the path item.
parentObject readonlyThe object's container.
subPathItemsSubPathItems SubPathItem readonlyThe sub path objects for this path item.
typenamestring readonlyThe class name of the object.

Methods

Instances

PathItem add ()
Adds an element.

void deselect ()
Unselects the selection, no path items are selected.

PathItem duplicate (relativeObject: Object, insertionLocation: ElementPlacement)
Duplicate this object.

ParameterTypeDescription
relativeObjectObject
insertionLocationElementPlacement:
ElementPlacement.PLACEAFTER
ElementPlacement.PLACEBEFORE
ElementPlacement.PLACEATEND

PathItem duplicate ([name: string])
Duplicates this path item.

ParameterTypeDescription
namestringThe name for the new path. (Optional)

void fillPath ([fillColor: any][, mode: ColorBlendMode][, opacity: number][, preserveTransparency: bool][, feather: number][, antiAlias: bool][, wholePath: bool])
Fills the area enclosed by the path.

ParameterTypeDescription
fillColor any The color of the fill for this path. (Optional)
modeColorBlendMode:
ColorBlendMode.NORMAL
ColorBlendMode.DISSOLVE
ColorBlendMode.BEHIND
ColorBlendMode.CLEAR
ColorBlendMode.DARKEN
ColorBlendMode.MULTIPLY
ColorBlendMode.COLORBURN
ColorBlendMode.LINEARBURN
ColorBlendMode.LIGHTEN
ColorBlendMode.SCREEN
ColorBlendMode.COLORDODGE
ColorBlendMode.LINEARDODGE
ColorBlendMode.OVERLAY
ColorBlendMode.SOFTLIGHT
ColorBlendMode.HARDLIGHT
ColorBlendMode.VIVIDLIGHT
ColorBlendMode.LINEARLIGHT
ColorBlendMode.PINLIGHT
ColorBlendMode.DIFFERENCE
ColorBlendMode.EXCLUSION
ColorBlendMode.HUE
ColorBlendMode.SATURATION
ColorBlendMode.COLOR
ColorBlendMode.LUMINOSITY
ColorBlendMode.HARDMIXBLEND
The blending mode of the fill for this path. (Optional)
opacitynumberThe opacity of the fill for this path (as a percentage). Range: 0.0 to 100.0. (Optional)
preserveTransparencyboolIf true, transparency is preserved. (Optional)
feathernumberThe feather amount in pixels. Range: 0.0 to 250.0. (Optional)
antiAliasboolIf true, uses anti-aliasing for the selection. (Optional)
wholePathboolIf true, uses all subpaths when doing the fill. (Optional)

void makeClippingPath ([flatness: number])
Makes this path item the clipping path for this document.

ParameterTypeDescription
flatnessnumberFlatness in device pixels; tells the PostScript printer how to approximate curves. Range: 0.2 to 100). (Optional)

void makeSelection ([feather: number][, antiAlias: bool][, operation: SelectionType])
Makes a selection object, whose border is the path, from this path item object.

ParameterTypeDescription
feathernumberThe feather amount in pixels. Range: 0.0 to 250.0. (Optional)
antiAliasboolIf true, the selection uses anti-aliasing. (Optional)
operationSelectionType:
SelectionType.REPLACE
SelectionType.EXTEND
SelectionType.DIMINISH
SelectionType.INTERSECT
The selection behavior relative to the existing selection (when a selection already exists). (Optional)

void remove ()
Deletes this object.

void removeAll ()
Deletes all elements.

void select ()
Makes this path item the active or selected path item.

void strokePath ([tool: ToolType][, simulatePressure: bool])
Strokes the path.

ParameterTypeDescription
toolToolType:
ToolType.PENCIL
ToolType.BRUSH
ToolType.ERASER
ToolType.BACKGROUNDERASER
ToolType.CLONESTAMP
ToolType.PATTERNSTAMP
ToolType.HEALINGBRUSH
ToolType.HISTORYBRUSH
ToolType.ARTHISTORYBRUSH
ToolType.SMUDGE
ToolType.BLUR
ToolType.SHARPEN
ToolType.DODGE
ToolType.BURN
ToolType.SPONGE
ToolType.COLORREPLACEMENTTOOL
The tool to use when stroking the path. (Optional)
simulatePressureboolIf true, simulates the pressure when using the tool. (Optional)

Return

PathItem PathItem.add ()

PathItem PathItem.duplicate (relativeObject: Object, insertionLocation: ElementPlacement)

PathItem PathItem.duplicate ([name: string])

PathItem PathItems.[] (index: uint)

PathItem PathItems.add (name: string, entirePath: Array of SubPathInfo)

PathItem PathItems.getByName (name: string)

Jongware, 28-Aug-2012 v3.0.3iContents :: Index