Debian Codegraph @

docs/tutorials/gtk4/display-widgets/image.rst

raw
1 .. currentmodule:: gi.repository
2
3 Image
4 =====
5
6 :class:`Gtk.Image` is a widget to display images.
7 Various kinds of object can be displayed as an image.
8 Most typically, you would load a :class:`Gdk.Texture` from a file, using the
9 convenience function :meth:`Gtk.Image.new_from_file`, or
10 :meth:`Gtk.Image.new_from_icon_name`.
11
12 :class:`Gtk.Image` displays its image as an icon, with a size that is determined
13 by the application. See :doc:`/tutorials/gtk4/display-widgets/picture` if you want to show
14 an image at is actual size.
15
16 Sometimes an application will want to avoid depending on external data files,
17 such as image files.
18 See the documentation of :class:`Gio.Resource` inside GIO, for details.
19 In this case, :attr:`Gtk.Image.props.resource` and
20 :meth:`Gtk.Image.new_from_resource`, should be used.