![]() |
![]() |
The Gtk::Image widget displays an image. Various kinds of object can be displayed as an image; most typically, you would load a Gdk::Pixbuf ("pixel buffer") from a file, and then display that.
Gtk::Image is a subclass of Gtk::Misc, which implies that you can align it (center, left, right) and add padding to it, using Gtk::Misc methods.
Gtk::Image is a "no window" widget (has no Gdk::Window of its own), so by default does not receive events. If you want to receive events on the image, such as button clicks, place the image inside a Gtk::EventBox, then connect to the event signals on the event box.
Public Member Functions | |
void | clear () |
Resets the image to be empty. | |
Glib::RefPtr<const Gdk::PixbufAnimation> | get_animation () const |
Gets the Gdk::PixbufAnimation being displayed by the Gtk::Image. | |
Glib::RefPtr<Gdk::PixbufAnimation> | get_animation () |
Gets the Gdk::PixbufAnimation being displayed by the Gtk::Image. | |
Glib::ustring | get_icon_name (IconSize& size) |
Glib::ustring | get_icon_name () const |
void | get_icon_set (IconSet& icon_set, IconSize& size) const |
void | get_image (Glib::RefPtr<Gdk::Image>& gdk_image, Glib::RefPtr<Gdk::Bitmap>& mask) const |
Glib::RefPtr<const Gdk::Pixbuf> | get_pixbuf () const |
Gets the Gdk::Pixbuf being displayed by the Gtk::Image. | |
Glib::RefPtr<Gdk::Pixbuf> | get_pixbuf () |
Gets the Gdk::Pixbuf being displayed by the Gtk::Image. | |
int | get_pixel_size () const |
Gets the pixel size used for named icons. | |
void | get_pixmap (Glib::RefPtr<Gdk::Pixmap>& pixmap, Glib::RefPtr<Gdk::Bitmap>& mask) const |
void | get_stock (Gtk::StockID& stock_id, IconSize& size) const |
ImageType | get_storage_type () const |
Gets the type of representation being used by the Gtk::Image to store image data. | |
const GtkImage* | gobj () const |
Provides access to the underlying C GtkObject. | |
GtkImage* | gobj () |
Provides access to the underlying C GtkObject. | |
Image (const Glib::RefPtr<Gdk::PixbufAnimation>& animation) | |
Image (IconSet& icon_set, IconSize size) | |
Image (const Gtk::StockID& stock_id, IconSize size) | |
Creates am Image displaying a stock icon. | |
Image (const Glib::RefPtr<Gdk::Pixbuf>& pixbuf) | |
Image (const std::string& file) | |
Image (const Glib::RefPtr<Gdk::Image>& image, const Glib::RefPtr<Gdk::Bitmap>& mask) | |
Image (const Glib::RefPtr<Gdk::Pixmap>& pixmap, const Glib::RefPtr<Gdk::Bitmap>& mask) | |
Image () | |
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_file () const |
Filename to load and display. | |
Glib::PropertyProxy<Glib::ustring> | property_file () |
Filename to load and display. | |
Glib::PropertyProxy_ReadOnly< Gtk::IconSet > | property_icon_set () const |
Icon set to display. | |
Glib::PropertyProxy<Gtk::IconSet> | property_icon_set () |
Icon set to display. | |
Glib::PropertyProxy_ReadOnly< int > | property_icon_size () const |
Symbolic size to use for stock icon. | |
Glib::PropertyProxy<int> | property_icon_size () |
Symbolic size to use for stock icon. | |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::Image >> | property_image () const |
A GdkImage to display. | |
Glib::PropertyProxy< Glib::RefPtr< Gdk::Image > > | property_image () |
A GdkImage to display. | |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::Pixmap >> | property_mask () const |
Mask bitmap to use with GdkImage or GdkPixmap. | |
Glib::PropertyProxy< Glib::RefPtr< Gdk::Pixmap > > | property_mask () |
Mask bitmap to use with GdkImage or GdkPixmap. | |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::Pixbuf >> | property_pixbuf () const |
A GdkPixbuf to display. | |
Glib::PropertyProxy< Glib::RefPtr< Gdk::Pixbuf > > | property_pixbuf () |
A GdkPixbuf to display. | |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::PixbufAnimation >> | property_pixbuf_animation () const |
GdkPixbufAnimation to display. | |
Glib::PropertyProxy< Glib::RefPtr< Gdk::PixbufAnimation > > | property_pixbuf_animation () |
GdkPixbufAnimation to display. | |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::Pixmap >> | property_pixmap () const |
A GdkPixmap to display. | |
Glib::PropertyProxy< Glib::RefPtr< Gdk::Pixmap > > | property_pixmap () |
A GdkPixmap to display. | |
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_stock () const |
Stock ID for a stock image to display. | |
Glib::PropertyProxy<Glib::ustring> | property_stock () |
Stock ID for a stock image to display. | |
Glib::PropertyProxy_ReadOnly< ImageType > | property_storage_type () const |
The representation being used for image data. | |
void | set (const Glib::RefPtr<Gdk::PixbufAnimation>& animation) |
Causes the Gtk::Image to display the given animation (or display nothing, if you set the animation to 0 ). | |
void | set (IconSet& icon_set, IconSize size) |
See new_from_icon_set() for details. | |
void | set (const Gtk::StockID& stock_id, IconSize size) |
See the Image::Image(const Gtk::StockID& stock_id, IconSize size) constructor for details. | |
void | set (const Glib::RefPtr<Gdk::Pixbuf>& pixbuf) |
See new_from_pixbuf() for details. | |
void | set (const std::string& filename) |
See new_from_file() for details. | |
void | set (const Glib::RefPtr<Gdk::Image>& gdk_image, const Glib::RefPtr<Gdk::Bitmap>& mask) |
See new_from_image() for details. | |
void | set (const Glib::RefPtr<Gdk::Pixmap>& pixmap, const Glib::RefPtr<Gdk::Bitmap>& mask) |
See new_from_pixmap() for details. | |
void | set_from_icon_name (const Glib::ustring& icon_name, IconSize size) |
See new_from_icon_name() for details. | |
void | set_pixel_size (int pixel_size) |
Sets the pixel size to use for named icons. | |
virtual | ~Image () |
Related Functions | |
(Note that these are not member functions.) | |
Gtk::Image* | wrap (GtkImage* object, bool take_copy=false) |
|
|
|
|
|
|
|
|
|
|
|
|
|
Creates am Image displaying a stock icon. Sample stock icon identifiers are Gtk::Stock::OPEN, Gtk::Stock::EXIT. Sample stock sizes are Gtk::ICON_SIZE_MENU, Gtk::ICON_SIZE_SMALL_TOOLBAR. If the stock icon name isn't known, a "broken image" icon will be displayed instead. You can register your own stock icon names - see Gtk::IconFactory::add().
|
|
|
|
|
|
Resets the image to be empty.
|
|
Gets the Gdk::PixbufAnimation being displayed by the Gtk::Image. The storage type of the image must be Gtk::IMAGE_EMPTY or Gtk::IMAGE_ANIMATION (see get_storage_type()). The caller of this function does not own a reference to the returned animation.
|
|
Gets the Gdk::PixbufAnimation being displayed by the Gtk::Image. The storage type of the image must be Gtk::IMAGE_EMPTY or Gtk::IMAGE_ANIMATION (see get_storage_type()). The caller of this function does not own a reference to the returned animation.
|
|
|
|
|
|
|
|
|
|
Gets the Gdk::Pixbuf being displayed by the Gtk::Image. The storage type of the image must be Gtk::IMAGE_EMPTY or Gtk::IMAGE_PIXBUF (see get_storage_type()). The caller of this function does not own a reference to the returned pixbuf.
|
|
Gets the Gdk::Pixbuf being displayed by the Gtk::Image. The storage type of the image must be Gtk::IMAGE_EMPTY or Gtk::IMAGE_PIXBUF (see get_storage_type()). The caller of this function does not own a reference to the returned pixbuf.
|
|
Gets the pixel size used for named icons.
|
|
|
|
|
|
Gets the type of representation being used by the Gtk::Image to store image data. If the Gtk::Image has no image data, the return value will be Gtk::IMAGE_EMPTY.
|
|
Provides access to the underlying C GtkObject.
Reimplemented from Gtk::Misc. |
|
Provides access to the underlying C GtkObject.
Reimplemented from Gtk::Misc. |
|
Filename to load and display. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
Filename to load and display. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
Icon set to display. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
Icon set to display. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
Symbolic size to use for stock icon. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
Symbolic size to use for stock icon. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
A GdkImage to display. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
A GdkImage to display. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
Mask bitmap to use with GdkImage or GdkPixmap. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
Mask bitmap to use with GdkImage or GdkPixmap. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
A GdkPixbuf to display. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
A GdkPixbuf to display. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
GdkPixbufAnimation to display. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
GdkPixbufAnimation to display. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
A GdkPixmap to display. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
A GdkPixmap to display. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
Stock ID for a stock image to display. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
Stock ID for a stock image to display. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
The representation being used for image data. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
Causes the Gtk::Image to display the given animation (or display nothing, if you set the animation to
|
|
See new_from_icon_set() for details.
|
|
See the Image::Image(const Gtk::StockID& stock_id, IconSize size) constructor for details.
|
|
See new_from_pixbuf() for details.
|
|
See new_from_file() for details.
|
|
See new_from_image() for details.
|
|
See new_from_pixmap() for details.
|
|
See new_from_icon_name() for details.
|
|
Sets the pixel size to use for named icons. If the pixel size is set to a value != -1, it is used instead of the icon size set by set_from_icon_name().
|
|
|