Gtk2::Gdk::Pixmap(3)

πŸ“¦
version 1.24993 Β· 2 versions
, in fedora 43

πŸ’… Gtk2::Gdk::Pixmap πŸ’…

okay bestie so this is the Gtk2::Gdk::Pixmap page from the gtk2-perl docs β€” it's literally just a wrapper for GdkPixmap, no cap. It's the thing you reach for when you want a lil offscreen canvas to draw on. Buckle up, we're going through every single method, fr fr 🫢


🌸 HIERARCHY 🌸

so here's the family tree, and yes the vibes are immaculate:

Glib::Object
+----Gtk2::Gdk::Drawable
     +----Gtk2::Gdk::Pixmap

Pixmap is a Drawable, and Drawable is a Glib::Object. It's giving nepo baby but make it graphics πŸ’€


✨ METHODS ✨

πŸ¦‹ pixmap = Gtk2::Gdk::Pixmap->new ($drawable, $width, $height, $depth)

pixmap = Gtk2::Gdk::Pixmap->new ($drawable, $width, $height, $depth)
  • $drawable β€” a Gtk2::Gdk::Drawable, or undef if you're feeling spicy πŸ™ˆ
  • $width β€” integer
  • $height β€” integer
  • $depth β€” integer

πŸŽ€ (pixmap, mask) = Gtk2::Gdk::Pixmap->colormap_create_from_xpm ($drawable, $colormap, $transparent_color, $filename)

(pixmap, mask) = Gtk2::Gdk::Pixmap->colormap_create_from_xpm ($drawable,
    $colormap, $transparent_color, $filename)
  • $drawable β€” a Gtk2::Gdk::Drawable or undef. It may be undef if $colormap is given. (one of the two, bestie, not neither πŸ‘€)
  • $colormap β€” a Gtk2::Gdk::Colormap or undef. This is the GdkColormap used for the new image; it may be undef if $drawable is given.
  • $transparent_color β€” a Gtk2::Gdk::Color or undef. It's the color of the pixels that are transparent in the input file. If it's undef, a default gets used.
  • $filename β€” a localized file name

πŸ’– ($pixmap, $mask) = Gtk2::Gdk::Pixmap->colormap_create_from_xpm_d ($drawable, $colormap, $transparent_color, @xpm_data)

($pixmap, $mask) = Gtk2::Gdk::Pixmap->colormap_create_from_xpm_d ($drawable,
    $colormap, $transparent_color, @xpm_data)
  • $drawable β€” a Gtk2::Gdk::Drawable or undef. May be undef if $colormap is given.
  • $colormap β€” a Gtk2::Gdk::Colormap or undef. The GdkColormap for the new image; may be undef if $drawable is given.
  • $transparent_color β€” a Gtk2::Gdk::Color or undef. The color of pixels that are transparent in the input file. If undef, a default is used.
  • ... β€” a list of strings, aka the xpm data

What it does: creates a pixmap from the xpm data you hand it, using a specific colormap. Also β€” see "create_from_xpm_d". πŸ‘‘


πŸ“ pixmap = Gtk2::Gdk::Pixmap->create_from_data ($drawable, $data, $width, $height, $depth, $fg, $bg)

pixmap = Gtk2::Gdk::Pixmap->create_from_data ($drawable, $data, $width,
    $height, $depth, $fg, $bg)
  • $drawable β€” a Gtk2::Gdk::Drawable
  • $data β€” a string
  • $width β€” integer
  • $height β€” integer
  • $depth β€” integer
  • $fg β€” a Gtk2::Gdk::Color
  • $bg β€” a Gtk2::Gdk::Color

look at all those args. seven of them. the way that this method ate πŸ’…


🧚 (pixmap, mask) = Gtk2::Gdk::Pixmap->create_from_xpm ($drawable, $transparent_color, $filename)

(pixmap, mask) = Gtk2::Gdk::Pixmap->create_from_xpm ($drawable,
    $transparent_color, $filename)
  • $drawable β€” a Gtk2::Gdk::Drawable
  • $transparent_color β€” a Gtk2::Gdk::Color or undef
  • $filename β€” a localized file name

🌈 ($pixmap, $mask) = Gtk2::Gdk::Pixmap->create_from_xpm_d ($drawable, $transparent_color, @xpm_data)

($pixmap, $mask) = Gtk2::Gdk::Pixmap->create_from_xpm_d ($drawable,
    $transparent_color, @xpm_data)
  • $drawable β€” a Gtk2::Gdk::Drawable, used to determine the colormap and visual of the image
  • $transparent_color β€” a Gtk2::Gdk::Color or undef. The color of pixels that are transparent in the input file. If undef, a default is used.
  • ... β€” a list of strings, the xpm data

What it does: creates a pixmap from the provided xpm data, usually included in the program as an inline image. And if you wanna know what the format of that data even is, see "new_from_xpm_data" in Gtk2::Gdk::Pixbuf. iykyk ✨


πŸ‘‘ pixmap = Gtk2::Gdk::Pixmap->foreign_new ($anid)

pixmap = Gtk2::Gdk::Pixmap->foreign_new ($anid)
  • $anid β€” a Gtk2::Gdk::NativeWindow

πŸ¦‹ pixmap = Gtk2::Gdk::Pixmap->foreign_new_for_display ($display, $anid)

pixmap = Gtk2::Gdk::Pixmap->foreign_new_for_display ($display, $anid)
  • $display β€” a Gtk2::Gdk::Display
  • $anid β€” a Gtk2::Gdk::NativeWindow

Since: gtk+ 2.2


⭐ pixmap = Gtk2::Gdk::Pixmap->foreign_new_for_screen ($screen, $anid, $width, $height, $depth)

pixmap = Gtk2::Gdk::Pixmap->foreign_new_for_screen ($screen, $anid, $width,
    $height, $depth)
  • $screen β€” a Gtk2::Gdk::Screen
  • $anid β€” a Gtk2::Gdk::NativeWindow
  • $width β€” integer
  • $height β€” integer
  • $depth β€” integer

Since: gtk+ 2.10


πŸ’œ pixmap = Gtk2::Gdk::Pixmap->lookup ($anid)

pixmap = Gtk2::Gdk::Pixmap->lookup ($anid)
  • $anid β€” a Gtk2::Gdk::NativeWindow

πŸŽ€ pixmap = Gtk2::Gdk::Pixmap->lookup_for_display ($display, $anid)

pixmap = Gtk2::Gdk::Pixmap->lookup_for_display ($display, $anid)
  • $display β€” a Gtk2::Gdk::Display
  • $anid β€” a Gtk2::Gdk::NativeWindow

Since: gtk+ 2.2


πŸ”₯ SEE ALSO πŸ”₯

  • Gtk2
  • Glib::Object
  • Gtk2::Gdk::Drawable

go read those too bestie, they're literally right there 🫢


Copyright (C) 2003-2011 by the gtk2-perl team.

This software is licensed under the LGPL. See Gtk2 for a full notice.


and that's the whole page, you ate that 🌈✨ this was perl v5.42.0, dated 2025-07-25, and it's the Gtk2::Gdk::Pixmap(3) manual page β€” go forth and draw pixels, main character πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from