---
name: "Gtk2::Image"
section: "3pm"
platform: "linux"
package: "libgtk2-perl-doc"
version: "2:1.24992-1"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/Gtk2::Image"
---

# Gtk2::Image(3pm)

wrapper for GtkImage

## NAME

Gtk2::Image - wrapper for GtkImage

## HIERARCHY

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

## INTERFACES

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

## METHODS

### 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)

### pixbufanimation = $image-\>get\_animation

### $image-\>clear

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

### pixbuf = $image-\>get\_pixbuf

### integer = $image-\>get\_pixel\_size

Since: gtk+ 2.6

### $image-\>set\_pixel\_size ($pixel\_size)

- •

  `$pixel_size` (integer)

Since: gtk+ 2.6

### list = $image-\>get\_pixmap

### (stock\_id, icon\_size) = $image-\>get\_stock

### imagetype = $image-\>get\_storage\_type

## PROPERTIES

- 'file' (string : default undef : readable / writable / private)

  Filename to load and display

- 'gicon' (Glib::Object::\_Unregistered::GIcon : default undef : readable / writable / private)

  The GIcon being displayed

- 'icon-name' (string : default undef : readable / writable / private)

  The name of the icon from the icon theme

- 'icon-set' (Gtk2::IconSet : default undef : readable / writable / private)

  Icon set to display

- 'icon-size' (integer : default 4 : readable / writable / private)

  Symbolic size to use for stock icon, icon set or named icon

- 'image' (Gtk2::Gdk::Image : default undef : readable / writable / private)

  A GdkImage to display

- 'mask' (Gtk2::Gdk::Pixmap : default undef : readable / writable / private)

  Mask bitmap to use with GdkImage or GdkPixmap

- 'pixbuf' (Gtk2::Gdk::Pixbuf : default undef : readable / writable / private)

  A GdkPixbuf to display

- 'pixbuf-animation' (Gtk2::Gdk::PixbufAnimation : default undef : readable / writable / private)

  GdkPixbufAnimation to display

- 'pixel-size' (integer : default -1 : readable / writable / private)

  Pixel size to use for named icon

- 'pixmap' (Gtk2::Gdk::Pixmap : default undef : readable / writable / private)

  A GdkPixmap to display

- 'stock' (string : default undef : readable / writable / private)

  Stock ID for a stock image to display

- 'storage-type' (Gtk2::ImageType : default "empty" : readable / private)

  The representation being used for image data

## ENUMS AND FLAGS

### enum Gtk2::IconSize

- •

  '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'

### enum Gtk2::ImageType

- •

  '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'

## SEE ALSO

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

## COPYRIGHT

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

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