Project

General

Profile

Actions

Images


A widget displaying an image. To manage any image resource, see Pix api instead.
If the image file contains an animation, the result will be animated too. The supported formats are the same than GTK+.

_gtkImageNew

Create a new image object.

Prototype : fun [Chn I u0 u1] ObjGtkWidget

channel Chn any channel
flag I a flag to give the type SCOL_IMAGE_EMPTY : create an empty image object. You can set a content later.
SCOL_IMAGE_FILE : create an image object from an image file. The supported formats are the same than GTK+. You can modify it later.
SCOL_IMAGE_PIX : create an image object from an existing pix object. You can modify it later.
SCOL_IMAGE_PIXANIM : create an image object from an existing animated pix object. You can modify it later.
SCOL_IMAGE_ICON : create an image object from an icon name of the current theme. You can modify it later.
SCIMAGE_STOCK : create an image object from a stock item name (owned to GTK+ or owned to you, via the factory (see this). You can modify it later.
param u0 This parameter depends to the previous flag. If flag is SCOL_IMAGE_FILE, SCOL_IMAGE_ICON or SCOL_IMAGE_STOCK, then param has a S type. It must be the filename to load or the name of the icon or the stock item.
If flag is SCOL_IMAGE_PIX or SCOL_IMAGE_PIXANIM, the type is ObjGtkPix, param must be a ObjGtkPix object
Otherwise, param should be nil
option u1 At this time, option should be a I object (integer) and depends to the previous flag. If the flag is SCOL_IMAGE_ICON or SCOL_IMAGE_STOCK, then option gives the predefined size of the icon / stock item : SCOL_ICON_SIZE_MENU, SCOL_ICON_SIZE_SMALL_TOOLBAR, SCOL_ICON_SIZE_LARGE_TOOLBAR, SCOL_ICON_SIZE_BUTTON, SCOL_ICON_SIZE_DND, SCOL_ICON_SIZE_DIALOG. An other value should not be set.
Otherwise, option should be nil

Return : ObjGtkWidget : a new image object or nil if error

_gtkImageSet

Changes the content of an existing image object.

Prototype : fun [ObjGtkWidget I u0 u1] ObjGtkWidget

image ObjGtkWidget an existing image object
flag I a flag to give the type SCOL_IMAGE_FILE : sets an image object from an image file. The supported formats are the same than GTK+. You can modify it later.
SCOL_IMAGE_PIX : sets an image object from an existing pix object. You can modify it later.
SCOL_IMAGE_PIXANIM : sets an image object from an existing animated pix object. You can modify it later.
SCOL_IMAGE_ICON : sets an image object from an icon name of the current theme. You can modify it later.
SCIMAGE_STOCK : sets an image object from a stock item name (owned to GTK+ or owned to you, via the factory (see this). You can modify it later.
param u0 This parameter depends to the previous flag. If flag is SCOL_IMAGE_FILE, SCOL_IMAGE_ICON or SCOL_IMAGE_STOCK, then param has a S type. It must be the filename to load or the name of the icon or the stock item.
If flag is SCOL_IMAGE_PIX or SCOL_IMAGE_PIXANIM, the type is ObjGtkPix, param must be a ObjGtkPix object
Otherwise, param should be nil
option u1 At this time, option should be a I object (integer) and depends to the previous flag. If the flag is SCOL_IMAGE_ICON or SCOL_IMAGE_STOCK, then option gives the predefined size of the icon / stock item : SCOL_ICON_SIZE_MENU, SCOL_ICON_SIZE_SMALL_TOOLBAR, SCOL_ICON_SIZE_LARGE_TOOLBAR, SCOL_ICON_SIZE_BUTTON, SCOL_ICON_SIZE_DND, SCOL_ICON_SIZE_DIALOG. An other value should not be set.
Otherwise, option should be nil

Return : ObjGtkWidget : the same image object or nil if error

_gtkImageRst

Resets an existing image object to be empty.

Prototype : fun [ObjGtkWidget] ObjGtkWidget

Return : ObjGtkWidget : the same object or nil if error

_gtkImageGetType

Returns the type of a image object

Prototype : fun [ObjGtkWidget] I

Return : I :
  • SCOL_IMAGE_EMPTY : there is no image displayed by the widget.
  • SCOL_IMAGE_PIX : the widget contains a pix object (directly from a pix object or from an image file).
  • SCOL_IMAGE_STOCK : the widget contains a stock icon name
  • SCOL_IMAGE_PIXANIM : the widget contains an animated pix object (directly from an animated pix object or from an image file).
  • SCOL_IMAGE_ICON : the widget contains a named icon.
  • nil if an errors occurs or if the type couldn't be unknown

_gtkImageGetContent

Returns the content of an image object. The return depends to the type of the image object.

Prototype : fun [ObjGtkWidget] [ObjGtkPix S I]

Return : [ObjGtkPix S I]
  • ObjGtkPix : a pix object, if the image object has it. Otherwise nil.
  • S : the name of the icon or the stock item; otherwise nil.
  • I : the size of the icon or stock item; otherwise nil

Return Api

Updated by iri about 13 years ago ยท 12 revisions