It looks like your (and my, and everyone else who has commented so far's) expectation of what "the image as a string" and "binary data" means doesn't jive with what it acctually means. Try this out and it works okay...
#!/usr/bin/perl use strict; use warnings; use Tk; use Tk::Photo; use Tk::PNG; my $file = shift or die "put a PNG file name on the command line"; my $mw = new MainWindow(); my $src = $mw->Photo(-format => 'png', -file => $file); my $tgt = $mw->Photo(-format => 'png', -data => $src->data(-format => +'png')); $mw->Label(-image => $tgt )->pack; MainLoop;
Inspecting the output of src->data(-format => 'png') to understand what exactly the differnce is is left as an excercise for the reader.
In reply to Re: Tk:Photo -data with binary data?
by hossman
in thread Tk:Photo -data with binary data?
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |