hill has asked for the wisdom of the Perl Monks concerning the following question:

I'm looking for an image viewer which can be called with Perl (lots of those around) and will let me 'print' another image to the viewer without killing its process and re-invoking the viewer (hence this question). The invoke/kill process causes, as you would expect, much screen flashing.

The actual goal is a simple approach to animating some data using ChartDirector (a really simple, useful plotting program/module discovered here on Perl Monks). I'd like to run the data through ChartDirector, print the output to the screen, grab the next sequence of data and overwrite the previous image without closing the viewer.

Many thanks for your attention.

Replies are listed 'Best First'.
Re: image viewer (mildly OT)
by zentara (Cardinal) on Nov 24, 2008 at 16:47 UTC
    Any of the Perl gui modules, Tk, Gtk2, Wx, etc will let you do it. Here is one of many variants on the theme. The idea( in Tk terminology) is to load your image into a Photo object, then update one of many widgets that will accept a Photo.....buttons..labels..a canvas, etc. You can get more advanced, and make your images dynamically from some data, or you can use a Canvas to plot your data, and update it (see second example). First example is a slideshow of all jpgs in a directory.

    Otherwise, be more specific in what you want to visualize, or show a sample code of your ChartDirector, showing how it outputs images. If it can write to an inline scalar, that would make it easy, as you can then avoid making temp images files.


    I'm not really a human, but I play one on earth Remember How Lucky You Are
Re: image viewer (mildly OT)
by jethro (Monsignor) on Nov 24, 2008 at 17:00 UTC