in reply to Re^3: Which tk to use and how to show images?
in thread Which tk to use and how to show images?

But I still think the plain canvas approach uses less cpu

Oh, I totally agree. If the graph is only ever to be displayed in Tk, and not re-used as an image elsewhere, a Canvas does make sense.

That said, GD::Graph does do some stuff with scaling and ticks, labels and pie-charts that are not trivial to reproduce.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re^4: Which tk to use and how to show images?

Replies are listed 'Best First'.
Re^5: Which tk to use and how to show images?
by rcseege (Pilgrim) on Nov 04, 2005 at 17:51 UTC

    Plus if you wanted to make the graphs interactive (make elements in the graph responsive to Mouse events) within Tk, then it would be easier with Canvas implementation -- or Tk::Graph for that matter. I'd like to see that module adapted for Tk::Zinc. It would gain some nice additional capabilities over Canvas.

      It would be nice if there was a Canvas method for dumping the image it renders, into the various graphic formats. I realise that you can query the pels and could format them up yourself, or import thme back into a GD object for outputting as an image, but that would be very slow.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
        There is Tk::WinPhoto, which captures to various formats. It has a few drawbacks, one of which is being slow. There is also a win32 version now Tk::WinPhoto for ActiveState.

        I'm not really a human, but I play one on earth. flash japh
        Well, there is: $canvas->postscript(...), but it tends to be imperfect -- especially dealing with fonts. It looks as though this is a future option for Zinc as well, but it isn't there yet.