Re: Working with an image from an http request



On Fri, 2005-06-24 at 11:18 +1000, Daniel Kasak wrote:
I'm using jpgraph on our webserver to create graphs.
I'm using LWP::Simple to fetch the graph, which is in PNG format.
...
I basically just want to display the image on-screen. Can I do anything
useful with this in-memory, or do I have to save it to a temporary file

Something like this should do the trick:

  my $loader = Gtk2::Gdk::PixbufLoader->new;
  $loader->write($png_data);
  $loader->close;
  my $pixbuf = $loader->get_pixbuf;

Regards
Grant




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]