## These cannot be run by examples() but should be OK when pasted
## into an interactive R session with the tcltk package loaded
ImgNames()
myImg <- ImgAdd(system.file("gui", "logoSciViews.gif", package = "svWidgets"))
myImg # Note that $Tk. is prepended to the name!
ImgNames()
ImgType(myImg)
# Place that logo in a Tk window
timg <- WinAdd("timg", title = "A Tk window with image", pos ="-40+20")
labImg <- tklabel(timg, image = ImgGet(myImg), bg = "white")
tkpack(labImg)
# When the image resource is deleted, it is not displayed any more (no error)
ImgDel(myImg)
ImgNames()
WinDel("timg")
# To read all image resources at once (place this in .Lib.first())
ImgReadPackage("svWidgets")
ImgNames()
rm(myImg)Run the code above in your browser using DataLab