User's Manual

MediaScript Objects and Methods 75
Example
var image = new Media();
image.load(name @ "logobg.tga");
image.drawText(Font @ "Arial", Style @ "Bold", Text @ "MediaScript:
Breakthrough Technology", Size @ 18, Color @ 0x0000FF, x @ 185, y @
30, Smooth @ true, Kern @ true);
image.save(type @ "jpeg");
dropShadow()
Adds a drop shadow to the image based on its alpha channel. The effects are best seen
when compositing the results onto another image. This function fully supports CMYK
image operations.
NOTE: Occasional unexpected results can often be corrected with the fixAlpha() command. See
“fixAlpha()” on page 80 for more details.
Syntax
dropShadow(
[ResizeCanvas @ <true, false>]
[layers @ <"layer list">] // (PSD files only)
[Opacity @ <value 0..255>]
[Blur @ <value 0..30>]
[Dx @ <number of pixels>]
[Dy @ <number of pixels>]
[Color @ <color in hexadecimal or rgb>]
[Index @ <value 0..16777215>]
);
Parameters
ResizeCanvas - provides for the canvas of the image to be automatically enlarged to
encompass the shadow produced. The image’s background color will be used for the
additional area. For more information about setting an image’s background color, see
setColor().
NOTE: The Enlarge parameter has been deprecated.
layers - for PSD files, specifies the layers to be affected. The layer numbers begin at 0
(background) and go up. For more information see “load()” on page 101.