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 ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1107800]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2024-04-18 06:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found