A SERVICE OF

logo

76 Chapter 3
Opacity - defines the level of transparency for the shadow. The default opacity is 255,
which is completely solid. The shadow affects the alpha channel of the image as well as the
visible channels.
Blur - adds blurring that results in a shadow with a more diffused look. Note, however,
that the larger the blur value, the more processing is required.
Dx and Dy - specify the offset of the shadow from the original, where positive values shift
the shadow down and to the right.
Color - specifies the color to be used for the shadow. The default is the foreground color.
Index - colorizes the image shadow using an available color palette for the source image
(as an alternative to the Color parameter).
NOTE: You cannot specify values for both the Color and Index parameters.
Example
var image = new Media();
var image2 = new Media();
image.load(name @ "peppers.tga");
image2.drawText(font @ "Arial", style @ "Bold", text @ "Fresh
Peppers!", angle @ 30, color @ 0x00ccff, size @ 36, smooth @ true,
baseline @ true, kern @ true);
image2.dropShadow(opacity @ 255, blur @ 2, dx @ 5, dy @ 15, color @
0x000000);
image.composite(source @ image2);
image.save(type @ "jpeg");
ellipse()
Draws and positions an ellipse on the image based on the specified parameters. This
method accepts all composite() parameters except HandleX and HandleY.
The foreground color may vary with this function, depending on the original Media object.
If the object has a set foreground color, or it is set with the setColor() function,
MediaRich uses the set color. However, if the object has no set foreground color, MediaRich
does the following:
For objects with 256 colors or less, MediaRich uses the last color index
For objects with 15-bit or greater resolution, MediaRich uses white
NOTE: Using ellipse() to mask frames within a JavaScript for loop can result in initially
poor anti-aliasing. To maintain optimal anti-aliasing, place the masking ellipse outside the loop.