tkImShow {tkImgR} | R Documentation |
Open and display an image in a canvas that can be zoomed and panned using the mouse and keyboard shortcuts
tkImShow(file, zoom = NULL, title = NULL)
file |
path to image file |
zoom |
the zoom factor (ratio), for zoom = 1 the image is shown with no zoom (original size), when zoom is < (>) than 1 the image is zoomed out (in). The default value of zoom is NULL. |
title |
the window title |
The tkwin
object returned by tkImShow
is a toplevel window with a canvas that contains several variables (canvasAllowZoom, canvasScrollWidth) and tkwin
objects (canvas, canvasScrollHorizontal, canvasScrollVertical) placed in the env
, which could be used to implement further methods.
file_path <- system.file("img", "example.png", package = "tkImgR")
tt <- tkImShow(file_path)
if (!identical(tcltk::tclRequire("Img", warn = FALSE),FALSE)){
file_path1 <- system.file("img", "example.jpg", package = "tkImgR")
tt <- tkImShow(file_path1)
}