User's Manual
MediaScript Objects and Methods 83
•
•
•
•
•
Example
if (image.getBytesPerPixel() == 3)
{...
NOTE: If you want MediaRich to return the bit-depth of the image, use the getImageFormat()
function.
getFrame()
Returns a Media object for the specified frame (if available), otherwise returns
“undefined”.
Syntax
<object name>.getFrame(
<frame offset>
);
Parameters
This function takes the specified frame offset (starting from 1) as an argument.
Example
var image = new Media();
image.load(name @ "Images/clock.gif"); // Load an animated GIF with
four frames
image2 = image.getFrame(2);
image2.save(name @ "frame2.gif");
getFrameCount()
Returns the number of frames in an animation.
Syntax
<object name>.getFrameCount();
Parameters
This function has no parameters.
Example
for (x = 0;x < image.getFrameCount();x++)
{...
getHeight()
Returns the vertical size in pixels.
Syntax
<object name>.getHeight();
Parameters
This function has no parameters.










