Packagecom.adobe.photoshop
Classpublic class Selection
InheritanceSelection Inheritance PhotoshopHostObject Inheritance CSHostObject Inheritance flash.utils.Proxy

The selected area of the document or layer.



Public Properties
 PropertyDefined By
  bounds : Array
[read-only] The bounding rectangle of the entire selection.
Selection
 InheritedhostObjectDelegate : HostObject
Getter for the delegate
CSHostObject
 Inheritedparent : *
[read-only]
PhotoshopHostObject
  solid : Boolean
[read-only] If true, the bounding rectangle a solid rectangle.
Selection
Public Methods
 MethodDefined By
  
clear():void
Clears the selection and does not copy it to the clipboard.
Selection
  
contract(by:String):void
Contracts the selection.
Selection
  
copy(merge:Boolean):void
Copies the selection to the clipboard.
Selection
  
cut():void
Cuts the current selection to the clipboard.
Selection
  
deselect():void
Deselects the current selection.
Selection
  
expand(by:String):void
Expands the selection.
Selection
  
feather(by:String):void
Feathers the edges of the selection.
Selection
  
fill(fillType:Object, mode:ColorBlendMode = null, opacity:Number = 100, preserveTransparency:Boolean):void
Fills the selection.
Selection
 Inherited
filterArgsForHBAPI(args:Array):Array
[static] Function to clean up the argument list and put it into a format that makes sense for HBAPI.
CSHostObject
 Inherited
filterSingleObjectForHBAPI(value:Object):Object
[static]
CSHostObject
 Inherited
getClassObjectForName(className:String):HostObject
[static] This returns a "Class" object, meaning, a HostObject that can be used to make static function calls or get static properties
CSHostObject
 Inherited
getSpecialTranslation(className:String, ho:HostObject, expectedReturnType:Class, ownerName:String):*
[static]
CSHostObject
  
grow(tolerance:Number, antiAlias:Boolean):void
Grows the selection to include all adjacent pixels falling within the specified tolerance range.
Selection
 Inherited
hostCall(name:String, expectedReturnType:Class, rawargs:Array):*
Encapsulates a function call to the host
CSHostObject
 Inherited
hostCallStatic(className:String, methodName:String, expectedReturnType:Class, rawargs:Array):*
[static] Implements a safe call of a static method on the host
CSHostObject
 Inherited
hostGet(name:String, expectedReturnType:Class):*
Encapsulates a property get to the host
CSHostObject
 Inherited
hostGetIndex(idx:Object, expectedReturnType:Class):*
Encapsulates a indexed get to the host
CSHostObject
 Inherited
hostGetStatic(className:String, propertyName:String, expectedReturnType:Class):*
[static] Implements a safe get of a static property on the host Used by for instance, all the enum implementations.
CSHostObject
 Inherited
hostSet(name:String, rawvalue:*):void
Encapsulates a property set to the host
CSHostObject
 Inherited
hostSetStatic(className:String, propertyName:String, rawvalue:*):*
[static] Implements a safe set of a static property on the host
CSHostObject
  
invert():void
Inverts the selection.
Selection
 Inherited
isDescendedFrom(clz:Class, ancClass:Class):Boolean
[static] Efficiently determines whether or not one class descends from another in inheritance hierarchy- class relationships are cached by the ClassUtils implementation- (uses org.as3commons lib to quickly discover class hierarchy.
CSHostObject
  
load(from:Channel, combination:SelectionType = null, inverting:Boolean = false):void
Loads the selection from the specified channel.
Selection
  
makeWorkPath(tolerance:Number):void
Makes this selection item the workpath for this document.
Selection
 Inherited
replaceDefaultArgs(args:Array, defaultArgs:Array):Array
Function to tidy up arguments prior to call.
CSHostObject
  
resize(horizontal:Number = 100, vertical:Number = 100, anchor:AnchorPosition = null):void
Resizes the selected area to the specified dimensions and anchor position.
Selection
  
resizeBoundary(horizontal:Number = 100, vertical:Number = 100, anchor:AnchorPosition = null):void
Scales the boundary of the selection.
Selection
  
rotate(angle:Number, anchor:AnchorPosition = null):void
Rotates the object.
Selection
  
rotateBoundary(angle:Number, anchor:AnchorPosition = null):void
Rotates the boundary of the selection.
Selection
  
select(region:Object, type:SelectionType = null, feather:Number = 0, antiAlias:Boolean = true):void
Selects the specified region.
Selection
  
selectAll():void
Selects the entire layer.
Selection
  
selectBorder(width:String):void
Selects the selection border only (in the specified width); subsequent actions do not affect the selected area within the borders.
Selection
  
similar(tolerance:Number, antiAlias:Boolean):void
Grows the selection to include pixels throughout the image falling within the tolerance range.
Selection
  
smooth(radius:Number):void
Cleans up stray pixels left inside or outside a color-based selection (within the radius specified in pixels).
Selection
  
store(into:Channel, combination:SelectionType = null):void
Saves the selection as a channel.
Selection
  
stroke(strokeColor:Object, width:Number, location:StrokeLocation = null, mode:ColorBlendMode = null, opacity:Number = 100, preserveTransparency:Boolean):void
Strokes the selection.
Selection
  
translate(deltaX:String = null, deltaY:String = null):void
Moves the object relative to its current position.
Selection
  
translateBoundary(deltaX:String = null, deltaY:String = null):void
Moves the boundary of selection relative to its current position.
Selection
 Inherited
wrapReturnedHostObject(rawObject:Object, expectedReturnType:Class, client:CSHostObject, propertyName:String):*
[static] Method used on static/normal get/ hostcalls
CSHostObject
Protected Methods
 MethodDefined By
 Inherited
createWithArgs(args:Array):void
CSHostObject
 Inherited
hostCreate(args:Array):void
CSHostObject
Property Detail
boundsproperty
bounds:Array  [read-only]

The bounding rectangle of the entire selection.


Implementation
    public function get bounds():Array
solidproperty 
solid:Boolean  [read-only]

If true, the bounding rectangle a solid rectangle.


Implementation
    public function get solid():Boolean
Method Detail
clear()method
public function clear():void

Clears the selection and does not copy it to the clipboard.

contract()method 
public function contract(by:String):void

Contracts the selection.

Parameters

by:String — (String) The amount to contract the selection.

copy()method 
public function copy(merge:Boolean):void

Copies the selection to the clipboard.

Parameters

merge:Boolean (default = NaN) — (Boolean) If true the copy includes all visible layers. If false, copies only from the current layer.

cut()method 
public function cut():void

Cuts the current selection to the clipboard.

deselect()method 
public function deselect():void

Deselects the current selection.

expand()method 
public function expand(by:String):void

Expands the selection.

Parameters

by:String — (String) The amount to expand the selection.

feather()method 
public function feather(by:String):void

Feathers the edges of the selection.

Parameters

by:String — (String) The amount to feather the edge.

fill()method 
public function fill(fillType:Object, mode:ColorBlendMode = null, opacity:Number = 100, preserveTransparency:Boolean):void

Fills the selection.

Parameters

fillType:Object — (Object) The color or history state with which to fill the object.
 
mode:ColorBlendMode (default = null) — (com.adobe.photoshop.ColorBlendMode) The color blend mode. ( default: ColorBlendMode.NORMAL )
 
opacity:Number (default = 100) — (Number) The opacity as a percentage. Range: 1 to 100. ( default: 100 )
 
preserveTransparency:Boolean (default = NaN) — (Boolean) If true, perserves transparencies.

grow()method 
public function grow(tolerance:Number, antiAlias:Boolean):void

Grows the selection to include all adjacent pixels falling within the specified tolerance range.

Parameters

tolerance:Number — (Number) The tolerance range. Range: 0 to 255. ( 0 - 255 )
 
antiAlias:Boolean — (Boolean) If true, anti-aliasing is used.

invert()method 
public function invert():void

Inverts the selection.

load()method 
public function load(from:Channel, combination:SelectionType = null, inverting:Boolean = false):void

Loads the selection from the specified channel.

Parameters

from:Channel — (com.adobe.photoshop.Channel) The channel to load the selection from.
 
combination:SelectionType (default = null) — (com.adobe.photoshop.SelectionType) How to combine the channel contents with the existing selection. ( default: SelectionType.REPLACE )
 
inverting:Boolean (default = false) — (Boolean) If true, selects the inverse of the channel contents. ( default: false )

makeWorkPath()method 
public function makeWorkPath(tolerance:Number):void

Makes this selection item the workpath for this document.

Parameters

tolerance:Number (default = NaN) — (Number) The tolerance in pixels.

resize()method 
public function resize(horizontal:Number = 100, vertical:Number = 100, anchor:AnchorPosition = null):void

Resizes the selected area to the specified dimensions and anchor position.

Parameters

horizontal:Number (default = 100) — (Number) The amount to scale the selection horizontally (as a percentage). ( default: 100.0 )
 
vertical:Number (default = 100) — (Number) The amount to scale the selection vertically (as a percentage). ( default: 100.0 )
 
anchor:AnchorPosition (default = null) — (com.adobe.photoshop.AnchorPosition) The point to scale around. ( default: AnchorPosition.MIDDLECENTER )

resizeBoundary()method 
public function resizeBoundary(horizontal:Number = 100, vertical:Number = 100, anchor:AnchorPosition = null):void

Scales the boundary of the selection.

Parameters

horizontal:Number (default = 100) — (Number) The amount to scale the object horizontally (as a percentage). ( default: 100.0 )
 
vertical:Number (default = 100) — (Number) The amount to scale the object vertically (as a percentage). ( default: 100.0 )
 
anchor:AnchorPosition (default = null) — (com.adobe.photoshop.AnchorPosition) The point to scale around. ( default: AnchorPosition.MIDDLECENTER )

rotate()method 
public function rotate(angle:Number, anchor:AnchorPosition = null):void

Rotates the object.

Parameters

angle:Number — (Number) The number of degrees to rotate the object.
 
anchor:AnchorPosition (default = null) — (com.adobe.photoshop.AnchorPosition) The point to rotate about. ( default: AnchorPosition.MIDDLECENTER )

rotateBoundary()method 
public function rotateBoundary(angle:Number, anchor:AnchorPosition = null):void

Rotates the boundary of the selection.

Parameters

angle:Number — (Number) The rotation angle (in degrees)
 
anchor:AnchorPosition (default = null) — (com.adobe.photoshop.AnchorPosition) The point to rotate about. ( default: AnchorPosition.MIDDLECENTER )

select()method 
public function select(region:Object, type:SelectionType = null, feather:Number = 0, antiAlias:Boolean = true):void

Selects the specified region.

Parameters

region:Object — (Object) Array of x and y coordinates that describe the corners of the selection, in the format [[x1, y1], [x2,y2],[x3, y3], [x4,y4]]
 
type:SelectionType (default = null) — (com.adobe.photoshop.SelectionType) The method for combining the new selection with the existing selection. ( default: SelectionType.REPLACE )
 
feather:Number (default = 0) — (Number) The feather amount. ( default: 0.0 )
 
antiAlias:Boolean (default = true) — (Boolean) If true, anti-aliasing is used. ( default: true )

selectAll()method 
public function selectAll():void

Selects the entire layer.

selectBorder()method 
public function selectBorder(width:String):void

Selects the selection border only (in the specified width); subsequent actions do not affect the selected area within the borders.

Parameters

width:String — (String) The width of the border selection.

similar()method 
public function similar(tolerance:Number, antiAlias:Boolean):void

Grows the selection to include pixels throughout the image falling within the tolerance range.

Parameters

tolerance:Number — (Number) The tolerance range. Range: 0 to 255.
 
antiAlias:Boolean — (Boolean) If true, anti-aliasing is used.

smooth()method 
public function smooth(radius:Number):void

Cleans up stray pixels left inside or outside a color-based selection (within the radius specified in pixels).

Parameters

radius:Number — (Number) The sample radius in pixels. Range: 0 to 100. ( 0 - 100 )

store()method 
public function store(into:Channel, combination:SelectionType = null):void

Saves the selection as a channel.

Parameters

into:Channel — (com.adobe.photoshop.Channel) The channel to save the selection to.
 
combination:SelectionType (default = null) — (com.adobe.photoshop.SelectionType) How to add the selection to the existing contents of the channel. ( default: SelectionType.REPLACE )

stroke()method 
public function stroke(strokeColor:Object, width:Number, location:StrokeLocation = null, mode:ColorBlendMode = null, opacity:Number = 100, preserveTransparency:Boolean):void

Strokes the selection.

Parameters

strokeColor:Object — (Object) The color to stroke the selection with.
 
width:Number — (Number) The stroke width.
 
location:StrokeLocation (default = null) — (com.adobe.photoshop.StrokeLocation) The stroke location. ( default: StrokeLocation.CENTER )
 
mode:ColorBlendMode (default = null) — (com.adobe.photoshop.ColorBlendMode) The color blend mode. ( default: ColorBlendMode.NORMAL )
 
opacity:Number (default = 100) — (Number) The opacity of the stroke color as a percentage. Range: 1 to 100. ( default: 100 )
 
preserveTransparency:Boolean (default = NaN) — (Boolean) If true, preserves transparency.

translate()method 
public function translate(deltaX:String = null, deltaY:String = null):void

Moves the object relative to its current position.

Parameters

deltaX:String (default = null) — (String) The amount to move the object horizontally.
 
deltaY:String (default = null) — (String) The amount to move the object vertically.

translateBoundary()method 
public function translateBoundary(deltaX:String = null, deltaY:String = null):void

Moves the boundary of selection relative to its current position.

Parameters

deltaX:String (default = null) — (String) The amount to move the object horizontally.
 
deltaY:String (default = null) — (String) The amount to move the object vertically.