Using Gradients - Adobe 65036570 - Director - PC User Manual

User guide
Hide thumbs Also See for 65036570 - Director - PC:
Table of Contents

Advertisement

Determine the color of an individual pixel of an image object or set that pixel's color
Use the
or
getPixel
setPixel
Copy part or all of an image object into a different image object
Use the
copyPixels()
rectangle to which you are copying the pixels, and the rectangle from which to copy the pixels in the source image.
The following statement copies a 40 x 40 rectangle from the upper-left area of the image object
the pixels into a 40 x 40 rectangle at the lower right of the 300 x 300 pixel object called
myNewImage.copyPixels(myImage, rect(260, 260, 300, 300), rect(0, 0, 40, 40))
When using
copyPixels()
copying before drawing them into the destination rectangle. You can apply blends and inks, change the foreground
or background colors, specify masking operations, and more. You specify these operations by adding a property list
at the end of the
copyPixels()
The following statement performs the same operation as the previous example and directs the script to use the
Reverse ink when rendering the pixels into the destination rectangle:
myNewImage.copyPixels(myImage, rect(260, 260, 300, 300), rect(0, 0, 40, 40),
[#ink: #reverse])
Make a new image object from the alpha channel information of a 32-bit image object
Use the
extractAlpha()
image object that you plan to reduce to a lower bit depth. Reducing the bit depth can delete the alpha information.
The following statement creates a new image object called
32-bit image object called
myImage
alphaImage = myImage.extractAlpha()
There are many more image-editing operations available through Lingo or JavaScript syntax. For a complete list, see
the Scripting Reference topics in the Director Help Panel.

Using gradients

Director can create gradients in the Paint window. You can use gradients with the Brush tool, the Bucket tool, the
Text tool, or any of the filled shape tools. Typically, a gradient consists of a foreground color at one side (or the center)
of an image and another color, the destination color, at the other side (or outside edge) of the image. Between the
foreground and destination colors, Director creates a blend of the two colors.
Use a gradient
1
Select the Brush tool, the Bucket tool, or one of the filled shape tools.
Select the type of gradient from the Gradient menu.
2
A
A. Gradient menu
method.
method. This method requires you to specify the image from which you are copying, the
, you can specify optional parameters that tell the script to modify the pixels you're
method.
method, which can be useful for preserving the alpha channel information of a 32-bit
:
from the alpha channel information of the
alphaImage
ADOBE DIRECTOR 11.0
User Guide
and puts
myImage
:
myNewImage
120

Advertisement

Table of Contents
loading

This manual is also suitable for:

Director 11

Table of Contents