A SERVICE OF

logo

134 Chapter 3
setLayer()
Replaces the Media object for the specified layer (if available). Used in conjunction with
getLayer(), this is commonly used to modify layer contents before calling the collapse()
function.
Syntax
<object name>.setLayer(
<layer index, object name>
);
Parameters
The first parameter represents the layer index (the first layer in a file is layer 0).
The second parameter names the Media object that contains the data with which the layer
is replaced.
Example
var image = new Media();
var Layer = new Media();
Layer = image.getLayer(2);
Layer.rotate(angle @ 30);
image.setLayer(2, Layer);
setLayerBlend()
Sets the blending mode of the media layer with the specified index (if available).
Syntax
<object name>.setLayerBlend(
<layer index>
<"blending mode">
);
Parameters
The first parameter specifies the layer index (starting from 0).
The second parameter specifies the blending mode to be used. Blend options are:
“Normal”, “Darken”, “Lighten”, “Hue”, “Saturation”, “Color”, “Luminosity”, “Multiply”,
“Screen”, “Dissolve”, “Overlay,” “HardLight”, “SoftLight”, “Difference”, “Exclusion”,
“Dodge”, “ColorBurn”, “Under”, and “Colorize” (causes only the hue component of the
source to be stamped down on the image).
NOTE: “Burn” has been deprecated. “ColorBurn” results in the same blend.
Example
var image = new Media();
image.setLayerBlend(2, "Difference");