User Guide

298 Chapter 12: Methods
x2 Required if drawing a line using x and y coordinates. An integer that specifies the x coordinate
of the end of the line.
y2 Required if drawing a line using x and y coordinates. An integer that specifies the y coordinate
of the end of the line.
colorObjOrParamList Required. A color object or parameter list that specifies the color of the
line or shapes border. The parameter list can be used instead of a simple color object to specify
the following properties.
point(x, y), point(x, y) Required if drawing a line using points. Two points that specify the
start and end points of the line.
rect Required if drawing a shape. A rectangle that specifies the rectangular region in which a
shape is drawn.
Example
This statement draws a 1-pixel, dark red, diagonal line from point (0, 0) to point (128, 86) within
the image of member Happy.
The following statement draws a dark red, 3-pixel unfilled oval within the image of member
Happy. The oval is drawn within the rectangle (0, 0, 128, 86).
See also
color(), copyPixels(), fill(), image(), setPixel()
duplicate() (Image)
Usage
-- Lingo syntax
imageObjRef.duplicate()
// JavaScript syntax
imageObjRef.duplicate();
Description
Image method. Creates and returns a copy of a given image.
The new image is completely independent of the original, and is not linked to any cast member.
If planning to make a lot of changes to an image, it is better to make a copy that is independent of
a cast member.
Parameters
None.
Property Description
#shapeType
A symbol value of #oval, #rect, #roundRect, or #line. The default is #line.
#lineSize
The width of the line to use in drawing the shape.
#color
A color object, which determines the color of the shape’s border.