Learn R Programming

tkImgR (version 0.0.5)

canvasAddBinds: Commands to zoom and pan the image using the mouse or the keyboard (or by evoking directly the function)

Description

Functions to zoom and pan the canvas, and add the bind to the canvas.

Usage

canvasAddBinds(W)

canvasControlButton4(W)

canvasControlDown(W)

canvasControlUp(W)

canvasSpace(W, ...)

canvasSpaceRelease(W)

canvasMotion(W, ...)

canvasLeft(W)

canvasRight(W)

canvasUp(W)

canvasDown(W)

canvasControlRight(W)

canvasMouseWheel(W, ...)

canvasControlLeft(W)

canvasControlMouseWheel(W, ...)

canvasPlus(W, ...)

canvasMinus(W, ...)

canvasShiftButton4(W, ...)

canvasShiftButton5(W, ...)

canvasShiftMouseWheel(W, ...)

Arguments

W

tktoplevel object with the canvas displaying the image

...

further arguments.

Value

No return value, called for side effects

Details

These functions define the keyboard and mouse controls for the toplevel window.

Examples

Run this code
# NOT RUN {
file_path <- system.file("img", "example.png", package = "tkImgR")
tt <- tkImShow(file_path)
Sys.sleep(0.25)
canvasLeft(tt)
Sys.sleep(0.25)
canvasControlLeft(tt)
Sys.sleep(0.25)
canvasRight(tt)
Sys.sleep(0.25)
tcltk::tkdestroy(tt)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab