Pic_add()

Copy graphical objects from picture to picture.

PIC_ADD item=Gobject [device=Gobject] Copy item to current
PIC_ADD item=Gobject [dest=Gobject] [device=Gobject] Copy item to picture or window

example:

	# Draw a line object, then copy it into
	# the last open window on picture 4
	# redraw the updated picture on device 3.
	>> my_line = Line:Draw(0.0,1.0,0.0,1.0,$green)
	>> Pic_add item=my_line dest=pic(4) device=dev(3)

Note: item can only ever be a primitive object or a window.

Pic_add()

This command allows graphical objects to be reshown more than once, moved from display to display or duplicated. Open GENIE contains a copy of every graphical object that has been created and is still in use (they can be removed permanently by the Delete() command).

Objects can either be referred to using the Pic(), Win(), Dev() or Obj() functions or obtained directly as an object reference when an object is created (as in the example above).

Note that the default destination for Pic_add() is the current Picture when "item" is a window, and is the Current Window when "item" is a primitive object.

Parameters:

Item (Gobject)

This must be an object reference to either a drawing primitive (e.g. a line) or a window. This parameter cannot be a device or picture reference. This is the item which is to be copied and redrawn at a new destination. Probably the most useful form of the command is to copy windows which already have several things drawn in them.

Dest (Gobject) [ default = current window ]

Specifies a destination picture or window. If a picture is specified and the "item" parameter is a primitive object the window used will be the last one in the picture. When the "item" parameter is a window, the window is simply added at the end of the specified picture.

Device (Gobject) [ default = current device ]

After adding an object to a picture, the object will be re-drawn, by default this will be on the current device. If this is not the device required, the device in which to re-draw the newly copied primitive can be specified explicitly.

RESULT = (Restype)

Returns a reference to the copied item. This allows "/alter" commands to be applied to the object without having to find it again.