canvas::snap(3tk)

πŸ“¦
version 0.9 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’… canvas::snap β€” the canvas::snap(3tk) glow-up ✨

okay bestie, sit down, hydrate, and let me tell you about a lil page from the canvas manual section β€” it's the one called canvas::snap, and it's literally the screenshot button for your canvases 🫢


🌸 NAME 🌸

canvas::snap β€” Canvas snapshot to Tk photo image πŸ“Έ

Like, it takes a pic of your canvas. Main character energy only.


✨ SYNOPSIS ✨

package require Tcl 8.5

package require Tk 8.5

package require canvas::snap ?1.0.1?

package require img::window

::canvas::snap pathName

so first you gotta pull in Tcl 8.5 and Tk 8.5 (the bare minimum, no cap), then canvas::snap itself β€” version 1.0.1 if you're being specific, but the ? marks mean that's optional, she's flexible πŸ’β€β™€οΈ β€” and also img::window, don't forget her, she's the one making the window magic happen. Then you call the one command. That's it. That's the whole vibe check.


πŸ’– DESCRIPTION πŸ’–

This package hands you a command that takes snapshots of arbitrary canvases. Any canvas. Yours, theirs, the one you made at 3am. It doesn't care. It's giving equal opportunity photographer. 🌈


πŸ‘‘ API πŸ‘‘

  • ::canvas::snap pathName β€” Takes a snapshot of the canvas pathName (yes, that exact canvas, the one you named). What you get back is the name of a new Tk photo image that holds the snapshot. So like, it doesn't just show you the pic, it births a photo image and tells you its name. Iconic behaviour, honestly. πŸ’…
⚠️ bestie. listen. this command has a side-effect and you need to know about it. To avoid having white rectangles where other windows might overlap the canvas, it forces the toplevel window that the canvas lives in to the top of the stacking order. so your window is gonna jump to the front. that's not a bug, that's the price of a clean screenshot. you've been warned, mwah πŸ˜­πŸ’–

πŸ¦‹ BUGS, IDEAS, FEEDBACK πŸ¦‹

ngl, this document and the package it describes will undoubtedly contain bugs and other problems. it's a manpage, it's software, it's life. πŸ™ˆ

Please report such bugs in the category canvas of the Tklib Trackers:

http://core.tcl.tk/tklib/reportlist

And please also report any ideas you have for enhancements β€” for either the package and/or the documentation. they want your thoughts, they're literally asking, go tell them 🫢


πŸŽ€ KEYWORDS πŸŽ€

canvas, image, photo, print screen, snapshot

(so if you were searching for "print screen" in a Tcl manpage context β€” hi, you found her πŸ‘‹)


Copyright (c) 2004 George Petasis (http://wiki.tcl.tk/1404)

Copyright (c) 2010 Documentation, Andreas Kupries


and that's the whole page, bestie!! this one ships with tklib, version 1.0.1, and it lives at canvas::snap(3tk). go forth and screenshot your canvases, just don't be shocked when your window yeets itself to the front πŸ’œβœ¨

πŸ“¦ where this page comes from