View source: R/bm_pixel_picker.R
bm_pixel_picker | R Documentation |
bm_pixel_picker()
lets you use an interactive graphics device
to click on a bitmap's pixels and learn the
column/row coordinates for the clicked pixel and its integer/color value.
To end the program click a non-left mouse button within the graphics device.
bm_pixel_picker(x, ...)
## S3 method for class 'bm_bitmap'
bm_pixel_picker(
x,
...,
col = getOption("bittermelon.col", col_bitmap),
silent = FALSE
)
## S3 method for class 'bm_pixmap'
bm_pixel_picker(x, ..., silent = FALSE)
## S3 method for class 'raster'
bm_pixel_picker(x, ..., silent = FALSE)
x |
Either a |
... |
Currently ignored. |
col |
Character vector of R color specifications. First color is used for values equal to 0, second color for values equal to 1, etc. |
silent |
Don't generate messages about clicked pixels. |
A list with named components "row", "col", and "value" for the last clicked pixel returned invisibly.
This function wraps grid::grid.locator()
.
if (interactive() && dev.interactive(orNone = TRUE)) {
corn <- farming_crops_16x16()$corn$portrait
bm_pixel_picker(corn)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.