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

My Task is this: I have something like a slider that is an applet, this
applet with GET send information to a perl script (CGI) and ok.
Now I want to send to the applet a dynamic icon at execution time.
I explain:
with GD i have made a 'icons creator' so:
1. i know that i can create a .png file and use it but:
2. with html i can strean an image with something like:
print STDOUT $image_data;
what about use this in the applet with something like

getImage("http://path/to/cgi_perl"); (<-- JAVA)
is possible? any idea? Thanks!

Replies are listed 'Best First'.
Re: Applet icons and GD
by Joost (Canon) on Jul 20, 2004 at 15:23 UTC
    Yes, that's possible, assuming your applet can load images via URLs.
    my $q = CGI->new(); my $data = create_png_image_data(); binmode STDOUT; print $q->header( -type => 'image/png' ); print $data;
    If you have a small set of possible images, I would suggest you create them once and save them as normal web-accessible png files, though. Then you won't need the perl code anymore, which will make your application a lot more efficient.