A SERVICE OF

logo

MediaScript Objects and Methods 71
Example
var image = new Media();
image.load(name @ "peppers.tga");
image.digimarcEmbed(Type @ "transaction", CreatorID @ 404407,
CreatorPin @ 32, DistributorID @ 2591, DistributorPin @ 1355,
TransactionID @ 667, Adult @ true, Restricted @ true,
CopyProtected @ true, Durability @ 16);
image.save(type @ "jpeg");
discard()
Removes the designated Media object from memory. This function fully supports CMYK
image operations.
Syntax
discard()
Example
var image = new Media();
image.load(name @ "peppers.tga");
image.discard();
drawText()
Composites the specified text string onto the image. This function fully supports CMYK
image operations.
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 (including the CMYK color-space),
MediaRich uses white
NOTE: Using drawText() within a JavaScript for loop can result in initially poor anti-
aliasing. To maintain optimal anti-aliasing, place the text object outside the loop.
Syntax
drawText(
[Font @ <"font family", "virtualfilesystem:/font family">]
[Style @ <"modifier">]
[Text @ <"string">]
[Color @ <color in hexadecimal or rgb>]
[Index @ <value 0..16777215>]
[Unlock @ <color in hexadecimal or rgb>]
[Saturation @ <value 0..255>]
[Size @ <value>]
[Justify @ <"left", "center", "right", "justified">]
[Wrap @ <pixel-width>]