img-window(3tk)

πŸ“¦
version 2.1.1 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– img-window β€” Tk window grab (window) πŸ’–

okay bestie, gather round, we're talking img-window from the Img manual (section 3tk) ✨


🌸 SYNOPSIS 🌸

package require img::window ?2.1?

that's it. that's the whole vibe. short, sweet, iconic. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so img::window is a sub-package of Img, right? and you can load it two ways, both slay:

  • as part of the whole complete Img support, via package require Img
  • or on its own, solo main-character style, via package require img::window

Like literally every other package in the Img family, it does not give you any new commands. nope. instead it extends the Tk command image that you already know and love 🫢. more specifically, img::window extends Tk's photo image type.

the name of the new format handler is window. remember that name, you'll need it. πŸŽ€

this handler does not provide any additional configuration options. zero. none. and that's on purpose, becauseβ€”

this handler is special, bestie. like, instead of reading or writing image data from a file or a string, it stores the contents of a Tk window in a photo image. yeah. a whole window. in a photo. obsessed. 😭πŸ”₯

so all of the above means that in a call like this:

image create photo ?name? ?options?

here's how it goes down:

  1. Image data in window format (that's the -data option, btw) is detected automatically. image data counts as being in the window format if the value you hand to the -data option is the name of an existing Tk window.
heads up: the standard option -file is not supported by this handler. nope. not a thing. don't try it. 🚫
  1. The format name window is recognized by the -format option.

and that's the whole entire deal. simple, but make it fashion. ✨


πŸ‘‘ SEE ALSO πŸ‘‘

the whole squad, fr fr:

  • img
  • img-bmp
  • img-dted
  • img-flir
  • img-gif
  • img-ico
  • img-jpeg
  • img-pcx
  • img-pixmap
  • img-png
  • img-ppm
  • img-ps
  • img-raw
  • img-sgi
  • img-sun
  • img-tga
  • img-tiff
  • img-window
  • img-xbm
  • img-xpm

all the legal sparkle, kept exactly as-is because we respect the icons who built this πŸ’œ:

  • Copyright (c) 1995-2025 Jan Nijtmans <nijtmans@users.sourceforge.net>
  • Copyright (c) 2002-2025 Andreas Kupries <andreas_kupries@users.sourceforge.net>
  • Copyright (c) 2003-2025 Paul Obermeier <obermeier@users.sourceforge.net>

and that's a wrap on img-window, bestie! this page is from version 2.1 of the Img docs, dated img-window(3tk) β€” go grab a window, turn it into a photo, and live your truth πŸ’…βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from