Gtk2::Image(3) User Contributed Perl Documentation Gtk2::Image(3)

Gtk2::Image - wrapper for GtkImage

Glib::Object
+----Glib::InitiallyUnowned
     +----Gtk2::Object
          +----Gtk2::Widget
               +----Gtk2::Misc
                    +----Gtk2::Image

Glib::Object::_Unregistered::AtkImplementorIface
Gtk2::Buildable

widget = Gtk2::Image->new

widget = Gtk2::Image->new_from_animation ($animation)

$animation (Gtk2::Gdk::PixbufAnimation)

widget = Gtk2::Image->new_from_file ($filename)

$filename (localized file name or undef)

widget = Gtk2::Image->new_from_icon_name ($icon_name, $size)

  • $icon_name (string)
  • $size (Gtk2::IconSize)

Since: gtk+ 2.6

widget = Gtk2::Image->new_from_icon_set ($icon_set, $size)

  • $icon_set (Gtk2::IconSet)
  • $size (Gtk2::IconSize)

widget = Gtk2::Image->new_from_image ($image, $mask)

  • $image (Gtk2::Gdk::Image or undef)
  • $mask (Gtk2::Gdk::Bitmap or undef)

widget = Gtk2::Image->new_from_pixbuf ($pixbuf)

$pixbuf (Gtk2::Gdk::Pixbuf or undef)

widget = Gtk2::Image->new_from_pixmap ($pixmap, $mask)

  • $pixmap (Gtk2::Gdk::Pixmap or undef)
  • $mask (Gtk2::Gdk::Bitmap or undef)

widget = Gtk2::Image->new_from_stock ($stock_id, $size)

  • $stock_id (string)
  • $size (Gtk2::IconSize)

Since: gtk+ 2.8

$image->set_from_animation ($animation)

$animation (Gtk2::Gdk::PixbufAnimation)

$image->set_from_file ($filename)

$filename (localized file name or undef)

$image->set_from_icon_name ($icon_name, $size)

  • $icon_name (string)
  • $size (Gtk2::IconSize)

Since: gtk+ 2.6

$image->set_from_icon_set ($icon_set, $size)

  • $icon_set (Gtk2::IconSet)
  • $size (Gtk2::IconSize)

$image->set_from_image ($gdk_image, $mask)

  • $gdk_image (Gtk2::Gdk::Image or undef)
  • $mask (Gtk2::Gdk::Bitmap or undef)

$image->set_from_pixbuf ($pixbuf)

$pixbuf (Gtk2::Gdk::Pixbuf or undef)

$image->set_from_pixmap ($pixmap, $mask)

  • $pixmap (Gtk2::Gdk::Pixmap or undef)
  • $mask (Gtk2::Gdk::Bitmap or undef)

$image->set_from_stock ($stock_id, $size)

  • $stock_id (string)
  • $size (Gtk2::IconSize)

list = $image->get_icon_name

Since: gtk+ 2.6

list = $image->get_icon_set

list = $image->get_image

Since: gtk+ 2.6

$image->set_pixel_size ($pixel_size)

$pixel_size (integer)

Since: gtk+ 2.6

list = $image->get_pixmap

'file' (string : default undef : readable / writable / private / static-nick / static-blurb)
Filename to load and display
'gicon' (Glib::Object::_Unregistered::GIcon : default undef : readable / writable / private / static-nick / static-blurb)
The GIcon being displayed
'icon-name' (string : default undef : readable / writable / private / static-nick / static-blurb)
The name of the icon from the icon theme
'icon-set' (Gtk2::IconSet : default undef : readable / writable / private / static-nick / static-blurb)
Icon set to display
'icon-size' (integer : default 4 : readable / writable / private / static-nick / static-blurb)
Symbolic size to use for stock icon, icon set or named icon
'image' (Gtk2::Gdk::Image : default undef : readable / writable / private / static-nick / static-blurb)
A GdkImage to display
'mask' (Gtk2::Gdk::Pixmap : default undef : readable / writable / private / static-nick / static-blurb)
Mask bitmap to use with GdkImage or GdkPixmap
'pixbuf' (Gtk2::Gdk::Pixbuf : default undef : readable / writable / private / static-nick / static-blurb)
A GdkPixbuf to display
'pixbuf-animation' (Gtk2::Gdk::PixbufAnimation : default undef : readable / writable / private / static-nick / static-blurb)
GdkPixbufAnimation to display
'pixel-size' (integer : default -1 : readable / writable / private / static-nick / static-blurb)
Pixel size to use for named icon
'pixmap' (Gtk2::Gdk::Pixmap : default undef : readable / writable / private / static-nick / static-blurb)
A GdkPixmap to display
'stock' (string : default undef : readable / writable / private / static-nick / static-blurb)
Stock ID for a stock image to display
'storage-type' (Gtk2::ImageType : default "empty" : readable / private / static-nick / static-blurb)
The representation being used for image data

  • 'invalid' / 'GTK_ICON_SIZE_INVALID'
  • 'menu' / 'GTK_ICON_SIZE_MENU'
  • 'small-toolbar' / 'GTK_ICON_SIZE_SMALL_TOOLBAR'
  • 'large-toolbar' / 'GTK_ICON_SIZE_LARGE_TOOLBAR'
  • 'button' / 'GTK_ICON_SIZE_BUTTON'
  • 'dnd' / 'GTK_ICON_SIZE_DND'
  • 'dialog' / 'GTK_ICON_SIZE_DIALOG'

  • 'empty' / 'GTK_IMAGE_EMPTY'
  • 'pixmap' / 'GTK_IMAGE_PIXMAP'
  • 'image' / 'GTK_IMAGE_IMAGE'
  • 'pixbuf' / 'GTK_IMAGE_PIXBUF'
  • 'stock' / 'GTK_IMAGE_STOCK'
  • 'icon-set' / 'GTK_IMAGE_ICON_SET'
  • 'animation' / 'GTK_IMAGE_ANIMATION'
  • 'icon-name' / 'GTK_IMAGE_ICON_NAME'
  • 'gicon' / 'GTK_IMAGE_GICON'

Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget, Gtk2::Misc

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

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

2023-07-25 perl v5.38.0