A bootstrap button that allows users to take a screenshot of specified HTML element (usually an image) and send it to the drawer canvas for editing. In addition, you can download it as "png" or "jpg" by opening up the dropdown menu.
toCanvasBtn(
dom,
canvasID,
isID = TRUE,
id = "",
label = "To Canvas",
color_class = "primary"
)
a HTML DOM selector, mostly common is to select the element by ID:
e.g. a plot with ID "plot1", to select, use dom = "plot1"
to select the plot if
isID = TRUE
. If isID = FALSE
, use dom = "#plot1"
Other complex selector is supported. First turn isID = FALSE
, then try things
like dom = ".btn i"
selects an icon inside an element
with "btn" class. If more than one element is matched, only the first one will
be screenshoted.
string, the ID of canvas. Unlike dom
, you should not add
"#" for canvasID
even if isID=FALSE
bool, TRUE
if you want to select the dom
by HTML ID, FALSE
if the selector is other than ID.
string, ID for this button, optional
label of this button, optional
bootstrap button color class suffix, usually one of 'default', 'primary', 'info', 'success', 'warning', 'danger'
a button
This component will not work unless a drawer canvas has been loaded on current document.
# see example of "canvas", `?canvas`