in reply to Tk Screen and Canvas Screenshots

That's pretty clever. I didn't know about this Window format for Photo. Is it new?

PNG might be a better choice than JPEG for storing Canvas screenshots; Canvases are likely to contain large areas of solid color and sharp color boundaries, which PNG handles beautifully and JPEG handles terribly.

Replies are listed 'Best First'.
Re^2: Tk Screen and Canvas Screenshots
by zentara (Cardinal) on Jun 05, 2004 at 11:42 UTC
    No it's not new, its just buried way down in Mastering PerlTk's chapter on images. It's been in TCL for along time. I guess people just havn't discovered it's full usefulness.

    Maybe the ease of ImageMagick's import program, has prevented more people from digging around for it. It's best use is to grab screenshots of Tk sub-widgets like a Canvas. Import won't do that without "rectangular-mouse-selection" which is kind of "inexact". And Canvas's export to postscript function has some glitches, especially when individual postscript elements are not visible. A straight pixmap shot is so much cleaner.

    Just put "use Tk::PNG;" at the top, and adjust the code accordingly to get png snapshots.


    I'm not really a human, but I play one on earth. flash japh