Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Trying to fetch image via URL Perl/Tk

by Loops (Curate)
on Nov 19, 2014 at 17:53 UTC ( #1107800=note: print w/replies, xml ) Need Help??


in reply to Trying to fetch image via URL Perl/Tk

Hi, welcome to the monastery.

Tk::Photo doesn't handle downloading images from a URL. However combined with a pair of additional modules, you can do it yourself:

use Tk; use Tk::Photo; use Tk::JPEG; use LWP::Simple; use MIME::Base64 qw(encode_base64); my $mw=new MainWindow; my $data = encode_base64 get('http://tinyurl.com/oyzuyjt'); my $shot=$mw->Photo(-data=>$data,-format=>'jpeg'); $mw->Label(-image=>$shot)->pack; MainLoop;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1107800]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2021-04-20 01:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?