The syntax is as follows:
on mouseUp -- or on cardOpen or stackOpen, etc.
picture [fileName, fileType, windowStyle, visible, depth]
end mouseUp
FileName is the name of a file or resource. These must be either PICT files
or PNTG files. To make these files a resource and a permanent part of the
stack, the stack must be modified with ResEdit.
FileType is the kind of file the picture is. It can be a resource file,
as mentioned above or it can be a separate file on the Macintosh. The
file can also be on the clipboard.
WindowStyle is the style of window in which the picture is displayed. You
can use any of the types of windows in the Macintosh toolbox: plain, rect,
zoom, roundRect, dialog, document, shadow, and windoid. The default type is
zoom, which is the kind of window a document is normally shown in with most
applications.
Visible is a Boolean value, meaning it can be true or false; true for
visible, false for invisible.
Depth is the bit depth of the off-screen buffer that's created by the
picture command. See "Picture Command" in the HyperCard Script Language
Guide for an explanation of how this works.
Example:
on mouseUp
picture, "Lake", resource, plain, true, 0
end mouseUp
This would display a picture titled "Lake", which had been made a part of
the stack with ResEdit. The picture would be visible and would be painted
on the screen with bit depth buffer of zero.
To dismiss a picture created with the picture command, you can either close
it using its close box (if there is one in its window) or you can script
it. You'd use the following syntax:
on mouseUp
close window "Lake"
end mouseUp
Note that you must say close window, not close picture.
This article is adapted from the Claris Tech Info database.