Skip to contents

Take screenshot of html image tile

Usage

snap_tile(
  output_path,
  screen_width = 800,
  screen_height = 700,
  dark_mode = FALSE,
  output_dir = getwd()
)

Arguments

output_path

Path to image file

screen_width

Width of the browser window

screen_height

Height of the browser window

dark_mode

Is the tile being saved dark or light mode?

output_dir

Directory where make_tile() wrote its files. Must match the output_dir used in the preceding make_tile() call. Defaults to getwd(). To snap a tile written to tempdir(), pass output_dir = tempdir() explicitly.

Value

Path to the saved PNG image (the value of output_path).

Examples

if (FALSE) { # file.exists(file.path(getwd(), "temp_hexsession", "_hexout.html")) && isTRUE(nzchar(tryCatch(chromote::find_chrome(), error = function(e) "")))
snap_tile(tempfile(fileext = ".png"))
}