# NOT RUN {
click.capture <- function(panel,x,y) {
if (is.null(panel$x)) {
panel$x <- as.numeric(x)
panel$y <- as.numeric(y)
}
else {
rp.line(panel, imagename=gulls.image, panel$x, panel$y,
as.numeric(x), as.numeric(y), width=3, id = "current")
panel$x <- as.numeric(x)
panel$y <- as.numeric(y)
}
panel
}
gulls.panel <- rp.control()
image.file <- file.path(system.file(package = "rpanel"), "images", "gulllmks.gif")
rp.image(gulls.panel, image.file, imagename="gulls.image", action = click.capture)
# }
Run the code above in your browser using DataLab