This has been on my mind for a while and maybe, this fits into the overhaul of Reaper's theme-stuff.
When I write scripts and I want to add a gui, I would love to make my gui as "compatible" to the style of the current theme as possible, which means, using the theme's colors and pictures.
The former is easy, the latter not, as themes are often stored as zip-files, not accessible with gfx.loadimg.
So here are some ideas, how to make loading and working with a theme's own images work.
1) string theme, integer width, integer height = gfx.loadthemeimg(integer image, string themeelement)
This loads an image from a theme. themeelement should be either the themeelement, as used by Walter or the dirctorystructure in the ReaperThemeZip-file/uncompressed theme-image-folder, whatever suits the needs best.
If no theme is loaded, it loads the 1.x-images instead.
2) gfx.resize_themeimage(integer image, integer newwidth, integer newheight)
This resizes the image, according to Walter's stretching-area-rules. That way, we could avoid distorted versions of button-images and resize them, like any other Walter-based-theme.
You know, the yellow and pink areas.
3) boolean retval = gfx.has_theme_changed()
This returns, if the theme has been changed/reloaded since last time calling this function within this script/deferred script.
If this returns true, I need to reload the images in my script to fit the style of the currently selected theme.
With these three functions, we could easily use theme-images in our scripts and create even more consistent layouts within Reaper in our guis. Would look very neat in Reaper 6, I think