The following routines are used to draw graphic elements on the pages of documents:
drawRect draws a filled or stroked rectangle
drawLine draws a line
drawRoundRect draws a filled or storked round rect
drawOval draws a filled or stroked oval
drawText draws a line of text
drawPicture draws a picture from the cast or from disk
drawStagePicture draws a picture of the Stage contents
drawRect
Syntax: drawRect document, rect, filled
Draws a rectangle on the current page. If the filled parameter is TRUE, the rectangle is filled using the current color. Otherwise, the rectangle is stroked using the current line weight and color.
Example:
drawRect doc, Rect(0,0,500,100), TRUE
drawLine
Syntax: drawLine document, startPoint, endPoint
Draws a line on the current page from startPoint to endPoint. The line is stroked using the current line weight and color.
Draws a rounded-corner rectangle on the current page, using the corner radius specified in cornerRadius. If the filled parameter is TRUE, the rounded rectangle is filled using the current color. Otherwise, the rounded rectangle is stroked using the current line weight and color.
Example:
drawRoundRect doc, Rect(0,0,500,100), 25, FALSE
drawOval
Syntax: drawOval document, bounds, filled
Draws an oval on the current page, bounded by the rectangle specified in bounds. If the filled parameter is TRUE, the oval is filled using the current color. Otherwise, the oval is stroked using the current line weight and color.
Example:
drawOval doc, Rect(0,0,100,100), FALSE
drawText
Syntax: drawText document, text, location
Draws a line of text on the current page, using the current text font, size, style, and justification. The justification specified using setTextJust determines how the text is aligned relative to the point specified in location.
Example:
drawText doc, "A little bit of text.", Point(100,50)
drawPicture
Syntax: drawPicture document, [ fileName | member castMem ],
[ rect | topLeftPoint ]
Draws a bitmapped or PICT cast member, EPS, PICT or BMP file from disk on the current page. If a destination rect is specified, the picture will be sized to fit within the rectangle without distortion. If a topLeftPoint is specified, the image will be drawn at 100% size from the specified point.
Examples:
drawPicture doc, member "image", Point(100,50)
drawPicture doc, the pathName&"image.eps", Rect(0,0,100,100)
drawStagePicture
Syntax: drawStagePicture document, [ rect | topLeftPoint ],
[ clipRect], grabOffscreen
Places a screen shot of the stage contents on the current page (or MIAW contents if drawStagePicture is called from a movie-in-a-window). If a clipRect is specified, only that portion of the stage or MIAW will be grabbed. Note that drawStagePicture takes a "faithful" screen grab of the stage contents, including the cursor, sprite "trails", and any other windows that might overlap the stage. However, if grabOffscreen is TRUE, the stage picture will be grabbed from Director's off-screen buffer instead, and these extraneous elements will not be included in the resulting picture.