Gtk2::Gdk::Pixmap(3)
π 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β aGtk2::Gdk::Drawable, orundefif 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β aGtk2::Gdk::Drawableorundef. It may beundefif$colormapis given. (one of the two, bestie, not neither π)$colormapβ aGtk2::Gdk::Colormaporundef. This is theGdkColormapused for the new image; it may beundefif$drawableis given.$transparent_colorβ aGtk2::Gdk::Colororundef. It's the color of the pixels that are transparent in the input file. If it'sundef, 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β aGtk2::Gdk::Drawableorundef. May beundefif$colormapis given.$colormapβ aGtk2::Gdk::Colormaporundef. TheGdkColormapfor the new image; may beundefif$drawableis given.$transparent_colorβ aGtk2::Gdk::Colororundef. The color of pixels that are transparent in the input file. Ifundef, 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β aGtk2::Gdk::Drawable$dataβ a string$widthβ integer$heightβ integer$depthβ integer$fgβ aGtk2::Gdk::Color$bgβ aGtk2::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β aGtk2::Gdk::Drawable$transparent_colorβ aGtk2::Gdk::Colororundef$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β aGtk2::Gdk::Drawable, used to determine the colormap and visual of the image$transparent_colorβ aGtk2::Gdk::Colororundef. The color of pixels that are transparent in the input file. Ifundef, 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β aGtk2::Gdk::NativeWindow
π¦ pixmap = Gtk2::Gdk::Pixmap->foreign_new_for_display ($display, $anid)
pixmap = Gtk2::Gdk::Pixmap->foreign_new_for_display ($display, $anid)
$displayβ aGtk2::Gdk::Display$anidβ aGtk2::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β aGtk2::Gdk::Screen$anidβ aGtk2::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β aGtk2::Gdk::NativeWindow
π pixmap = Gtk2::Gdk::Pixmap->lookup_for_display ($display, $anid)
pixmap = Gtk2::Gdk::Pixmap->lookup_for_display ($display, $anid)
$displayβ aGtk2::Gdk::Display$anidβ aGtk2::Gdk::NativeWindow
Since: gtk+ 2.2
π₯ SEE ALSO π₯
Gtk2Glib::ObjectGtk2::Gdk::Drawable
go read those too bestie, they're literally right there π«Ά
π COPYRIGHT π
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
- fedora 43: perl-Gtk2 1.24993-23.fc43 Β· LicenseRef-Callaway-LGPLv2+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms