fabricerin (version 0.1.1)

fabric_curtail: Add a background or an overlay image to a preexisting canvas

Description

Add a background or an overlay image to a preexisting canvas

Usage

fabric_curtail(cid, imgsrc, type = "background")

Arguments

cid

the id of the canvas element

imgsrc

the URL source of the image

type

whether to use an image as a 'background' or as an 'overlay'

Value

a canvas with a background or overlay image

Examples

Run this code
# NOT RUN {
if (interactive()) {

img <- "https://st.depositphotos.com/1642482/1904/i/950/depositphotos_19049237-stock-photo-leaf.jpg"

ui <- fluidPage(

use_fabric(),


fabric_shape(cid = "canvas123",
             shapeId = "tri1",
             shape = "Triangle",
             fill = "darkblue"),

fabric_curtail(cid = "canvas123",
             imgsrc = img,
             type = "background"

             )

)

server <- function(input, output) {}


shinyApp(ui = ui, server = server)

}
# }

Run the code above in your browser using DataCamp Workspace