display image in tcltk window with R… How?

2019-08-18 03:21发布

问题:

Can anyone tell me how to dislpay an image in a tcltk window ?

I found Img package here : sourceforge (1.3 version) but I can't install it manually because of missing 'DESCRIPTION' file.

How can I install it ?

-> How can I display image on a tcltk window (using Img package or not) ?

thank you

Config : Windows 7 64 bits, R 3.0.1

回答1:

You can use a label for this:

w <- tktoplevel()
tcl("image","create","photo", "imageID", file="your_image.gif")
l <- ttklabel(w, image="imageID", compound="image")
tkpack(l)

This only supports a limited number of file formats though.