if (do_name() != 'Home') : ?>
include("util/comment.php"); ?>
photobot.Layer.duplicate()
endif ?>Syntax
canvas.layers[i].duplicate()
Description
Creates a copy of layer i. This copy becomes the top layer on the canvas, and retains the same position, blend mode and opacity as the original layer.
The name of the duplicate is identical to the name of the original layer.
Example
photobot = ximport("photobot") canvas = photobot.canvas(100,100) canvas.layer("robot.jpg", name="robot") for i in range(2,50): canvas.layers[1].duplicate() canvas.layers[i].name += " " + str(i) print canvas.layers[i].name canvas.layers[i].translate(0,i)