MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING Reference page 276

Director scripting reference
Table of Contents

Advertisement

createMatte()
Syntax
imageObject.createMatte({alphaThreshold})
Description
This function creates and returns a matte object that you can use with
the effect of the matte sprite ink. The matte object is created from the specified image object's
alpha layer. The optional parameter
alpha channel value is below that threshold. It is used only with 32-bit images that have an alpha
channel. The
alphaThreshold
Matte objects aren't image objects; they are useful only with the
time, if you plan to use the same image as a matte more than once, it's best to create the matte and
save it in a variable for reuse.
Example
This statement creates a new matte object from the alpha layer of the image object testImage and
ignores pixels with alpha values below 50%:
newMatte = testImage.createMatte(128)
See also
copyPixels(),
crop() (Image)
Usage
-- Lingo syntax
imageObjRef.crop(rectToCropTo)
// JavaScript syntax
imageObjRef.crop(rectToCropTo);
Description
Image method. Returns a new image object that contains a copy of a source image object,
cropped to a given rectangle.
Calling
does not alter the source image object.
crop()
The new image object does not belong to any cast member and has no association with the Stage.
To assign the new image to a cast member, set the
Parameters
Required. The rectangle to which the new image is cropped.
rectToCropTo
Example
This Lingo takes a snapshot of the Stage and crops it to the
current appearance of that sprite on the Stage:
This statement uses the rectangle of cast member Happy to crop the image of cast member
Flower, then sets the image of cast member Happy to the result:
member("Happy").image = member("Flower").image.crop(member("Happy").rect)
276
Chapter 12: Methods
alphaThreshold
must be a value between 0 and 255.
createMask()
copyPixels()
excludes from the matte all pixels whose
copyPixels()
property of that cast member.
image
of sprite 10, capturing the
rect
to duplicate
function. To save

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DIRECTOR MX 2004-DIRECTOR SCRIPTING and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Director mx 2004

Table of Contents