A SERVICE OF

logo

MediaScript Objects and Methods 133
Example
var image = new Media();
image.load(name @ "car.tga");
image.setColor(backcolor @ 0xC2270B);
image.crop(alg @ "backcolor");
image.save(type @ "jpeg", compressed @ true);
setFrame()
Replaces the Media object for the specified frame (if available). Can be used with
getFrame() to modify an animation.
Syntax
<object name>.setFrame(
<frame offset>
<source Media object name>
);
Parameters
The frame offset (starting from 1) specifies which frame in the target Media object gets
replaced by the named source Media object (which consists of a single frame).
Example
var image = new Media();
image.load(name @ "Images/clock.gif"); // Load an animated GIF with
four frames
image2 = image.getFrame(2);
image2.flip(axis @ "Vertical");
image.setFrame(2, image2);
image.save(name @ "newclock.gif");