in reply to Re^2: Downloading KeyForge image
in thread Downloading KeyForge image
Seems to only work if you base64 encode the binary
pojuse 5.010; use strict; use warnings; use LWP::UserAgent; use Tk; use Tk::PNG; use MIME::Base64; my $url = 'http://www.perl.com/images/ads/tpcip_banner-1200x150.png'; my $ua = LWP::UserAgent->new(agent => ''); my $response = $ua->get($url); die $response->status_line if not $response->is_success; my $data = MIME::Base64::encode_base64($response->decoded_content()); my $mw = MainWindow->new; my $photo = $mw->Photo(-data => $data, -format => 'PNG'); $mw->Label(-image => $photo)->pack(); MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Downloading KeyForge image
by Stamm (Sexton) on May 21, 2019 at 21:07 UTC | |
by poj (Abbot) on May 21, 2019 at 21:15 UTC |