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

Yeah, you have it pretty close, by undef'ing $gd. I ran your code with a repeat and it leveled out after about 200 updates, only gaining about 200k, which is probably due to the total area of bar space displayed maxing out eventually. But I still think the plain canvas approach uses less cpu.

I'm not really a human, but I play one on earth. flash japh
  • Comment on Re^3: Which tk to use and how to show images?

Replies are listed 'Best First'.
Re^4: Which tk to use and how to show images?
by BrowserUk (Patriarch) on Nov 04, 2005 at 17:44 UTC
    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.

      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.