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

I am not author of Tcl/Tk.

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

I am maintainer of Tcl::Tk, but I am not author of Tcl::Tk either.

  • Comment on Re^15: Tk:Photo -data with binary data?

Replies are listed 'Best First'.
Re^16: Tk:Photo -data with binary data?
by BrowserUk (Patriarch) on Jun 08, 2007 at 07:27 UTC
    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.
      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.