Lingo Dictionary > G-K > image |  |

image

Syntax

    whichMember.image
    (the stage).image
    window(windowName).image

Description

This property refers to the image object of a bitmap or text cast member, of the Stage, or of a window. You can get or set a cast member's image, but you can only get the image of the Stage or a window.

Setting a cast member's image property immediately changes the contents of the member. However, when you get the image of a member or window, Director creates a reference to the image of the specified member or window. If you make changes to the image, the contents of the cast member or window change immediately.

If you plan to make a lot of changes to an item's image property, it is faster to copy the item's image property into a new image object using the `duplicate()` function, apply your changes to the new image object, and then set the original item's image to the new image object. For non-bitmap members, it is always faster to use the `duplicate()` function.

The `image` property can be tested but not set for text, Flash, and vector shape members.

Example

This statement puts the image of cast member originalFlower into cast member newFlower.

    member("newFlower").image = member("originalFlower").image

Example

These statements place a reference to the image of the stage into the variable `myImage` and then put that image into cast member flower.

    myImage=(the stage).image
    member("flower").image = myImage

See also

`setPixel(), draw(), image(), fill(), duplicate() (image function), copyPixels()`