To change the image assigned to a bitmap cast member:
•
Set the
picture
Scripting Reference topics in the Director Help Panel.
To specify the background or foreground of a bitmap sprite:
•
Set the
backColor
see the Scripting Reference topics in the Director Help Panel.
To capture the current graphic contents of the Stage:
•
Set a bitmap's
information about these properties, see the Scripting Reference topics in the Director
Help Panel.
For example, the
the current image of the Stage the image for the bitmap cast member Archive.
Creating image objects
An image object can be either a self-contained set of image data or a reference to the image data of
a cast member or of the Stage. If an image object is created by referring to a cast member, the
object contains a reference to the image of the member. The following statement creates an image
object that contains a reference to the image of the cast member called Boat.
myImage = member("Boat").image
Because the image object
make to the object are reflected in the cast member. These changes are also reflected in any sprites
made from that cast member.
You can also create an image object that contains a reference to the graphic contents of the Stage:
myImage = window("stage").image
Any changes to this image object are reflected on the Stage.
•
To create an image object that is a self-contained set of image data instead of a reference to a
cast member, you must tell the script what kind of image you want to create. You must provide
the parameters that describe the size and bit depth of the image you are creating.
The following statement creates an image object that contains a 640 x 480 pixel, 16-bit image:
myImage = image(640, 480, 16)
Editing image objects
After you create an image object, its data can be edited with a variety of scripting commands that
are designed to manipulate the pixels of the image. You can crop images, draw new pixels on
them, copy sections of them, and work with mask and alpha channel information. For more
information, see the Scripting Reference topics in the Director Help Panel.
To draw a line on an image object:
•
Use the
draw()
the line's color.
cast member property. For more information about this property, see the
or
sprite property. For more information about these properties,
foreColor
cast member property to the Stage's
picture
member("Archive").picture = (the stage).picture
contains a reference to the cast member Boat, any changes you
myImage
method. You must specify the locations of each end of the line in addition to
Controlling bitmap images with Lingo or JavaScript syntax
property. For more
picture
statement makes
115
Need help?
Do you have a question about the DIRECTOR MX 2004-USING DIRECTOR and is the answer not in the manual?
Questions and answers