in reply to Re^15: Tk:Photo -data with binary data?
in thread Tk:Photo -data with binary data?

I am user of Tcl/Tk, who happen to use it indirectly (from Perl). I am maintainer of Tcl::Tk,

Then you presumably have enough understanding of how these components fit together and work, and have an existing installation that would have allowed you to write and test that this actually worked:

#!/usr/bin/wish package require Img set fdata [read [open "/test/colorcube.png"]] label .l1 -image [image create photo -format png -data $fdata] pack .l1

Before suggesting Tcl::Tk as a solution?


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^17: Tk:Photo -data with binary data?
by vkon (Curate) on Jun 08, 2007 at 08:42 UTC
    this do what you want:
    use Tcl::Tk; my $int = new Tcl::Tk; $int->packageRequire('img::png'); open my $fh, "valid-xhtml10.png"; binmode $fh; $int->mainwindow->Label(-image => $int->imageCreate('photo', -data=>join'', <$fh>, ))->pack; $int->MainLoop;
    your Tcl/Tk code probably misses 'binmode'
    yet img::png...

    as for related mailing list, you'll more chance on help on it because it is more on-topic.

    PM is good resource but your question will not always find a person who could answer.