问题
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.
来源:https://stackoverflow.com/questions/17580818/display-image-in-tcltk-window-with-r-how