tkImShow {tkImgR}R Documentation

Open and Display Image in a Tk Canvas

Description

Open and display an image in a canvas that can be zoomed and panned using the mouse and keyboard shortcuts

Usage

tkImShow(file, zoom = NULL, title = NULL)

Arguments

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

Value

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.

Examples



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)
}

[Package tkImgR version 0.0.5 Index]