The Image widget displays an image. Various kinds of objects can be
displayed as an image; most typically you would create a
Pixbuf
from a file and then display that.
If the file isn't loaded successfully, the image will contain a
"broken image" icon similar to that used in many web browsers.
Image
public Image()
Constructs a new Image. This will be displayed as a "no image" icon until
an image is set using one of the set* methods.
Image
public Image(String filename)
Construct a new image passing the filename of an image.
filename
- The filename for the image to load.
Image
public Image(String iconName,
IconSize size)
Create an Image
Image
public Image(Image image,
Bitmap mask)
Create an Image widget displaying a image and a mask.
A org.gnu.gdk.Image is a client-side image buffer in the pixel format
of the current display.
image
- The org.gnu.gdk.Image to use for this object creation.mask
- The org.gnu.gdk.Mask to apply to the image.
Image
public Image(Pixbuf pixbuf)
Creates an Image from a
Pixbuf
.
pixbuf
- The Pixbuf to use for the Image creation.
Image
public Image(PixbufAnimation animation)
Creates an Image displaying the given PixbufAnimation.
animation
- The PixbufAnimation to use for this object creation.
Image
public Image(Pixmap pixmap,
Bitmap mask)
Create an Image from a
Pixmap
.
pixmap
- The Pixmap to use for the Image creation.mask
- The mask to apply to the created Image.
Image
public Image(Handle handle)
Construct an Image from a handle to a native resource.
Image
public Image(GtkStockItem stockId,
IconSize size)
Create an Image displaying a Stock icon.
stockId
- The id of the Stock icon to display.size
- The size of the icon.
Image
public Image(IconSet iconSet,
IconSize size)
Creates an Image displaying an IconSet.
iconSet
- The IconSet to use for the Image.size
- The IconSize to use for the Image.
getIconName
public String getIconName()
getPixelSize
public int getPixelSize()
getStorageType
public ImageType getStorageType()
Gets the type of representation being used by the Image to store
image data.
getType
public static Type getType()
Retrieve the runtime type used by the GLib library.
- getType in interface Misc
gtk_image_get_animation
protected static final Handle gtk_image_get_animation(Handle image)
gtk_image_get_icon_name
protected static final void gtk_image_get_icon_name(Handle image,
String iconName,
int[] size)
gtk_image_get_icon_set
protected static final void gtk_image_get_icon_set(Handle image,
Handle iconSet,
int[] size)
gtk_image_get_image
protected static final void gtk_image_get_image(Handle image,
Handle gdkImage,
Handle mask)
gtk_image_get_pixbuf
protected static final Handle gtk_image_get_pixbuf(Handle image)
gtk_image_get_pixel_size
protected static final int gtk_image_get_pixel_size(Handle image)
gtk_image_get_pixmap
protected static final void gtk_image_get_pixmap(Handle image,
Handle pixmap,
Handle mask)
gtk_image_get_stock
protected static final void gtk_image_get_stock(Handle image,
String[] stockId,
int[] size)
gtk_image_get_storage_type
protected static final int gtk_image_get_storage_type(Handle image)
gtk_image_get_type
protected static final int gtk_image_get_type()
gtk_image_new
protected static final Handle gtk_image_new()
gtk_image_new_from_animation
protected static final Handle gtk_image_new_from_animation(Handle animation)
gtk_image_new_from_file
protected static final Handle gtk_image_new_from_file(String filename)
gtk_image_new_from_icon_name
protected static final Handle gtk_image_new_from_icon_name(String iconName,
int size)
gtk_image_new_from_icon_set
protected static final Handle gtk_image_new_from_icon_set(Handle iconSet,
int size)
gtk_image_new_from_image
protected static final Handle gtk_image_new_from_image(Handle image,
Handle mask)
gtk_image_new_from_pixbuf
protected static final Handle gtk_image_new_from_pixbuf(Handle pixbuf)
gtk_image_new_from_pixmap
protected static final Handle gtk_image_new_from_pixmap(Handle pixmap,
Handle mask)
gtk_image_new_from_stock
protected static final Handle gtk_image_new_from_stock(String stockId,
int size)
gtk_image_set_from_animation
protected static final void gtk_image_set_from_animation(Handle image,
Handle animation)
gtk_image_set_from_file
protected static final void gtk_image_set_from_file(Handle image,
String filename)
gtk_image_set_from_icon_name
protected static final void gtk_image_set_from_icon_name(Handle image,
String iconName,
int size)
gtk_image_set_from_icon_set
protected static final void gtk_image_set_from_icon_set(Handle image,
Handle iconSet,
int size)
gtk_image_set_from_image
protected static final void gtk_image_set_from_image(Handle image,
Handle gdkImage,
Handle mask)
gtk_image_set_from_pixbuf
protected static final void gtk_image_set_from_pixbuf(Handle image,
Handle pixbuf)
gtk_image_set_from_pixmap
protected static final void gtk_image_set_from_pixmap(Handle image,
Handle pixmap,
Handle mask)
gtk_image_set_from_stock
protected static final void gtk_image_set_from_stock(Handle image,
String stockId,
int size)
gtk_image_set_pixel_size
protected static final void gtk_image_set_pixel_size(Handle image,
int pixelSize)
set
public void set(String filename)
Sets the image from a file
filename
- The filename for the image to load.
set
public void set(String iconName,
IconSize size)
set
public void set(Image image,
Bitmap mask)
Sets the image widget to displaying a image and a mask.
A org.gnu.gdk.Image is a client-side image buffer in the pixel format
of the current display.
image
- The org.gnu.gdk.Image to use for this object.mask
- The org.gnu.gdk.Mask to apply to the image.
set
public void set(Pixbuf pixbuf)
pixbuf
- The Pixbuf to use for the Image.
set
public void set(PixbufAnimation animation)
Sets to image to the given PixbufAnimation.
animation
- The PixbufAnimation to use for this object.
set
public void set(Pixmap pixmap,
Bitmap mask)
Sets the image to the given
Pixmap
.
pixmap
- The Pixmap to use for the Image.mask
- The mask to apply to the Image.
set
public void set(GtkStockItem stockId,
IconSize size)
Set the image to a Stock icon.
stockId
- The id of the Stock icon to display.size
- The size of the icon.
set
public void set(IconSet iconSet,
IconSize size)
Sets the image to displayian IconSet.
iconSet
- The IconSet to use for the Image.size
- The IconSize to use for the Image.
setPixelSize
public void setPixelSize(int pixelSize)