File: image.rst

package info (click to toggle)
pygobject 3.55.3-3
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 6,000 kB
  • sloc: ansic: 39,431; python: 26,883; sh: 114; makefile: 81; xml: 35; cpp: 1
file content (20 lines) | stat: -rw-r--r-- 800 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
.. currentmodule:: gi.repository

Image
=====

:class:`Gtk.Image` is a widget to display images.
Various kinds of object can be displayed as an image.
Most typically, you would load a :class:`Gdk.Texture` from a file, using the
convenience function :meth:`Gtk.Image.new_from_file`, or
:meth:`Gtk.Image.new_from_icon_name`.

:class:`Gtk.Image` displays its image as an icon, with a size that is determined
by the application. See :doc:`/tutorials/gtk4/display-widgets/picture` if you want to show
an image at is actual size.

Sometimes an application will want to avoid depending on external data files,
such as image files.
See the documentation of :class:`Gio.Resource` inside GIO, for details.
In this case, :attr:`Gtk.Image.props.resource` and
:meth:`Gtk.Image.new_from_resource`, should be used.