Lingo Dictionary > G-K > image() |  |

image()

4020 | Lingo_depth_of_image_help

4037 | Lingo_height_of_image_help

Syntax

    image(width, height, bitDepth {, alphaDepth} {, paletteSymbolOrMember})

Description

Function; creates and returns a new image object of the dimensions specified by `width`, `height`, and `bitDepth`, with optional `alphaDepth` and `paletteObject` values.

The `bitDepth` can be 1, 2, 4, 8, 16, or 32. The `alphaDepth`, if given, is used only for 32-bit images and must be 0 or 8. The `paletteObject`, if given, is used only for 2-, 4-, and 8-bit images and can be either a palette symbol, such as `#grayscale`, or a palette cast member. If no palette is specified, the movie's default palette is used.

Image objects created with `image()` are independent and do not refer to any cast member or window.

To see an example of `image()` used in a completed movie, see the Imaging movie in the Learning\Lingo Examples folder inside the Director application folder.

Example

These statements create a 200 x 200 pixel, 8-bit image object and fills the image object with red.

    redSquare = image(200, 200, 8)
    redSquare.fill(0, 0, 200, 200, rgb(255, 0, 0))

See also

`palette, image, duplicate() (image function), fill()`