org.gnome.gtk

## Class Image

- Object
- - org.freedesktop.bindings.Pointer
  - - org.freedesktop.bindings.Proxy
    - - org.gnome.glib.Object
      - - org.gnome.gtk.Widget
        - - org.gnome.gtk.Misc
          - - org.gnome.gtk.Image

-     public class Image
      extends Misc

  A Widget that displays an image.
  Since:
    4.0.3
  Author:
    Sebastian Mancke, Andrew Cowie, Guillaume Mazoyer

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.gnome.gtk.Widget

      `Widget.ButtonPressEvent, Widget.ButtonReleaseEvent, Widget.Destroy, Widget.Draw, Widget.EnterNotifyEvent, Widget.FocusInEvent, Widget.FocusOutEvent, Widget.Hide, Widget.KeyPressEvent, Widget.KeyReleaseEvent, Widget.LeaveNotifyEvent, Widget.MapEvent, Widget.MotionNotifyEvent, Widget.PopupMenu, Widget.QueryTooltip, Widget.ScrollEvent, Widget.SizeAllocate, Widget.UnmapEvent, Widget.VisibilityNotifyEvent`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Image()` Create a new, but empty, Image Widget.
    `Image(Icon icon, IconSize size)` Construct a new Image based on an icon which is in the icons theme.
    `Image(Pixbuf pixbuf)` Construct a new Image Widget from an image already loaded into a Pixbuf.
    `Image(Stock stock, IconSize size)` Construct a new Image based on one of the Stock icons.
    `Image(String filename)` Construct a new Image Widget from the image located at the specified path.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()` Reset this Image to be empty.
    `void` | `setImage(Icon icon, IconSize size)` Specify the icon to be displayed by this Image.
    `void` | `setImage(Pixbuf pixbuf)` Specify the Pixbuf to be presented by this Image.
    `void` | `setImage(Stock stock, IconSize size)` Specify a stock icon to be displayed by this Image.
    `void` | `setImage(String filename)` Specify the filename to load and parse as image data to be displayed in this Image.

    - ### Methods inherited from class org.gnome.gtk.Misc

      `getAlignmentX, getAlignmentY, getPaddingX, getPaddingY, setAlignment, setPadding`

    - ### Methods inherited from class org.gnome.gtk.Widget

      `activate, addEvents, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, destroy, getAllocatedHeight, getAllocatedWidth, getAllocation, getCanDefault, getCanFocus, getHasFocus, getName, getParent, getPreferredHeightForWidthMinimum, getPreferredHeightForWidthNatural, getPreferredHeightMinimum, getPreferredHeightNatural, getPreferredWidthForHeightMinimum, getPreferredWidthForHeightNatural, getPreferredWidthMinimum, getPreferredWidthNatural, getRequestMode, getRequisition, getSensitive, getStyleContext, getToplevel, getWindow, grabAdd, grabDefault, grabFocus, grabRemove, hide, isSensitive, overrideBackground, overrideColor, overrideFont, queueDraw, queueDrawArea, realize, setAlignHorizontal, setAlignVertical, setCanDefault, setCanFocus, setEvents, setExpandHorizontal, setExpandVertical, setName, setSensitive, setSizeRequest, setTooltipMarkup, setTooltipText, show, showAll`

    - ### Methods inherited from class org.freedesktop.bindings.Pointer

      `toString`

    - ### Methods inherited from class Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Image

          public Image()

      Create a new, but empty, Image Widget. You can use the setters on this class to emplace image data later.

      Although this can be used as a blank slate upon which you can do arbitrary Cairo drawing in an `Widget.Draw` signal handler, you are better off using `DrawingArea` for that purpose.

      Since:
        4.0.7

    - #### Image

          public Image(Icon icon,
               IconSize size)

      Construct a new Image based on an icon which is in the icons theme. As each one actually comes in various sizes, you have to say which variant you want. If, for a reason or another, the icon is not in the theme, a broken icon will be used.
      Since:
        4.0.17

    - #### Image

          public Image(Pixbuf pixbuf)

      Construct a new Image Widget from an image already loaded into a Pixbuf.
      Since:
        4.0.5

    - #### Image

          public Image(Stock stock,
               IconSize size)

      Construct a new Image based on one of the Stock icons. As each one actually comes in various sizes, you have to say which variant you want.

      In most cases, you shouldn't need this; most of the special purpose Widgets have constructors which directly use a Stock item (see `ImageMenuItem` or `ToolButton` for example) and which will take care of the sizing issues for you.

      Since:
        4.0.6

    - #### Image

          public Image(String filename)

      Construct a new Image Widget from the image located at the specified path. This always results in a new Image; if the file is not found the Image will be populated with the "broken image" icon.

  - ### Method Detail

    - #### clear

          public void clear()

      Reset this Image to be empty.
      Since:
        4.0.8

    - #### setImage

          public void setImage(Icon icon,
                      IconSize size)

      Specify the icon to be displayed by this Image. See the `constructor` taking an Icon instance.
      Since:
        4.0.17

    - #### setImage

          public void setImage(Pixbuf pixbuf)

      Specify the Pixbuf to be presented by this Image.
      Since:
        4.0.8

    - #### setImage

          public void setImage(Stock stock,
                      IconSize size)

      Specify a stock icon to be displayed by this Image. See the `constructor` taking a Stock instance.
      Since:
        4.0.8

    - #### setImage

          public void setImage(String filename)

      Specify the filename to load and parse as image data to be displayed in this Image. See the filename `constructor`.
      Since:
        4.0.8