Gtk2::G...ufLoader(3)

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

πŸ’– Gtk2::Gdk::PixbufLoader β€” the whole vibe πŸ’–

okay bestie, so this page is from the User Contributed Perl Documentation corner of the perl-verse, and it's all about Gtk2::Gdk::PixbufLoader β€” which is just a lil wrapper for GdkPixbufLoader πŸŽ€. it loads pixbufs. it's giving image-decoder-with-main-character-energy. no cap.


🌸 HIERARCHY 🌸

the family tree, and yes it's a whole lineage:

Glib::Object
+----Gtk2::Gdk::PixbufLoader

so it inherits from Glib::Object and that's the entire ancestry, periodt. πŸ‘‘


✨ METHODS ✨

pixbufloader = Gtk2::Gdk::PixbufLoader->new

the classic. just make one. that's it, that's the method. πŸ’…

pixbufloader = Gtk2::Gdk::PixbufLoader->new_with_mime_type ($mime_type)

make a loader but you already know the mime type, so you tell it upfront. may croak with a Glib::Error in $@ on failure β€” so like, wrap it, bestie, don't just rawdog it. 😭

Since: gtk+ 2.4 β€” so if you're on something ancient, this one's not for you.

pixbufloader = Gtk2::Gdk::PixbufLoader->new_with_type ($image_type)

same energy but you're passing an image type instead of a mime type. may croak with a Glib::Error in $@ on failure. protect ya neck. 🫢

pixbufanimation or undef = $loader->get_animation

grab the animation if there is one β€” and note the or undef, because sometimes there just isn't and the universe said no. 🌈

$loader->close

close it up, wrap it up, done. may croak with a Glib::Error in $@ on failure. πŸŽ€

hash reference = $loader->get_format

you get back a hash reference with the format deets. iconic.

Since: gtk+ 2.2

pixbuf = $loader->get_pixbuf

the moment we've all been waiting for β€” it hands you the actual pixbuf. ate. πŸ”₯

$loader->set_size ($width, $height)

set the size, obviously. the args:

  • $width (integer) β€” the width, fr fr
  • $height (integer) β€” the height, obviously
Since: gtk+ 2.2

boolean = $loader->write ($buf)

feed it data, get a boolean back. the args:

  • $buf (scalar)

may croak with a Glib::Error in $@ on failure. ngl this is the one you'll be calling in a loop like a lil gremlin, so handle the croak. πŸ™ˆ


πŸ¦‹ SIGNALS πŸ¦‹

the loader talks back, and here's everything it says:

  • area-prepared (Gtk2::Gdk::PixbufLoader)
  • area-updated (Gtk2::Gdk::PixbufLoader, integer, integer, integer, integer)
  • closed (Gtk2::Gdk::PixbufLoader)
  • size-prepared (Gtk2::Gdk::PixbufLoader, integer, integer)

yes, area-updated takes four integers. it's extra like that. πŸ’…


πŸ‘‘ SEE ALSO πŸ‘‘

go read these too, bestie, they're the lore:

  • Gtk2
  • Glib::Object

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

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


okay that's the whole page!! this lil doc was cooked up by the perl crew on 2025-07-25 and it's running on perl v5.42.0 β€” the perl documentation girlies really said "here's your manual, slay". go forth and load some pixbufs, bestie, you got this πŸ§šπŸ’–βœ¨

πŸ“¦ where this page comes from