display image in tcltk window with R… How?

2019-08-18 03:05发布

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条回答
Rolldiameter
2楼-- · 2019-08-18 03:26

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.

查看更多
登录 后发表回答