in reply to view online jpeg in Tk ?
#!/usr/bin/perl -w use strict; use Tk; use Tk::JPEG; use LWP::Simple; use MIME::Base64; my $URL = 'http://zentara.net/2uni2.jpg'; my $content = encode_base64(get($URL)) or die $!; my $mw = MainWindow->new(); my $image = $mw->Photo(-data => $content); $mw->Label(-image => $image)->pack(-expand => 1, -fill => 'both'); $mw->Button(-text => 'Quit', -command => [destroy => $mw])->pack; MainLoop; ############################################# #1 liner # perl -MLWP::Simple -MMIME::Base64 -MTk -MTk::JPEG -e '$mw=tkinit; # $mw->Label(-image => $mw->Photo(-data => encode_base64(get(shift))) +)->pack;MainLoop' # http://...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: view online jpeg in Tk ?
by Anonymous Monk on Sep 11, 2006 at 19:58 UTC |