Livecode Wiki
Advertisement

Specifies an image whose mask is used as the shape of the window.Syntax:

set the windowShape of stack to {imageID | 0}

Examples:

set the windowShape of this stack to 974

Use the windowShape property to display a special-purpose window shape.

If the image has a 1-bit transparency mask, the shape of this mask is used to clip the window: the mask is superimposed on the window, and any pixels that fall outside the mask are not displayed. For example, if you set a stack's windowShape to an image whose mask is a rectangle with rounded corners, the window is shown with rounded corners, and the parts of the stack in the corners are hidden.

If the image has a full alpha-mask and the running platform supports the feature (currently Windows 2000 and later, and MacOS X) then the alpha-mask of the window will be set to that of the image. This will result in the transparency of each pixel in the window being determined by the corresponding pixel in the alpha-mask of the image. Any pixel more transparent than a system-specific threshold value will be treated as fully transparent with regards to mouse-clicks and other events.

For 1-bit masks, the window needs to be re-created whenever the windowShape property is set making it unsuitable for animation. However, alpha-masked windows suffer no such limitation and it is possible to set the windowShape property successively to such images without any flicker.

The border and title bar of a stack are not shown if

the stack's (object) windowShape is set. This means you will need to provide methods of dragging and closing the window if you want the user to be able to do these tasks.

To revert to the normal window shape, set the windowShape to zero.

Changes: The ability to use images with full (]] 1-bit) alpha masks was introduced in version 2.6.

See also: stack (object),ID (property),style (property),maskData (property),decorations (property),iconic (property),

Advertisement