Images » History » Version 12
iri, 03/31/2011 11:34 AM
| 1 | 1 | iri | h1. Images |
|---|---|---|---|
| 2 | |||
| 3 | !>http://library.gnome.org/devel/gtk/unstable/image.png! |
||
| 4 | 2 | iri | A *widget* displaying an image. To manage any image resource, see [[Pix]] api instead. |
| 5 | 1 | iri | If the image file contains an animation, the result will be animated too. The supported formats are the same than GTK+. |
| 6 | |||
| 7 | 7 | iri | |
| 8 | {{toc}} |
||
| 9 | |||
| 10 | 1 | iri | h2. _gtkImageNew |
| 11 | |||
| 12 | Create a new image object. |
||
| 13 | |||
| 14 | Prototype : *fun [Chn I u0 u1] ObjGtkWidget* |
||
| 15 | |||
| 16 | table. |
||
| 17 | |*channel*|Chn|any channel|| |
||
| 18 | 4 | iri | |*flag*|I|a flag to give the type|SCOL_IMAGE_EMPTY : create an empty image object. You can set a content later.| |
| 19 | 1 | iri | | | | |SCOL_IMAGE_FILE : create an image object from an image file. The supported formats are the same than GTK+. You can modify it later.| |
| 20 | | | | |SCOL_IMAGE_PIX : create an image object from an existing pix object. You can modify it later.| |
||
| 21 | | | | |SCOL_IMAGE_PIXANIM : create an image object from an existing animated pix object. You can modify it later.| |
||
| 22 | | | | |SCOL_IMAGE_ICON : create an image object from an icon name of the current theme. You can modify it later.| |
||
| 23 | 3 | iri | | | | |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.| |
| 24 | 1 | iri | |*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.| |
| 25 | | | | |If _flag_ is SCOL_IMAGE_PIX or SCOL_IMAGE_PIXANIM, the type is ObjGtkPix, _param_ must be a ObjGtkPix object| |
||
| 26 | | | | |Otherwise, _param_ should be nil| |
||
| 27 | |*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.| |
||
| 28 | | | | |Otherwise, _option_ should be nil| |
||
| 29 | |||
| 30 | +Return+ : ObjGtkWidget : a new image object or nil if error |
||
| 31 | |||
| 32 | 11 | iri | h2. _gtkImageSet |
| 33 | |||
| 34 | Changes the content of an existing image object. |
||
| 35 | |||
| 36 | Prototype : *fun [ObjGtkWidget I u0 u1] ObjGtkWidget* |
||
| 37 | |||
| 38 | table. |
||
| 39 | |*image*|ObjGtkWidget|an existing image object| | |
||
| 40 | |*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.| |
||
| 41 | | | | |SCOL_IMAGE_PIX : sets an image object from an existing pix object. You can modify it later.| |
||
| 42 | | | | |SCOL_IMAGE_PIXANIM : sets an image object from an existing animated pix object. You can modify it later.| |
||
| 43 | | | | |SCOL_IMAGE_ICON : sets an image object from an icon name of the current theme. You can modify it later.| |
||
| 44 | | | | |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.| |
||
| 45 | |*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.| |
||
| 46 | | | | |If _flag_ is SCOL_IMAGE_PIX or SCOL_IMAGE_PIXANIM, the type is ObjGtkPix, _param_ must be a ObjGtkPix object| |
||
| 47 | | | | |Otherwise, _param_ should be nil| |
||
| 48 | |*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.| |
||
| 49 | | | | |Otherwise, _option_ should be nil| |
||
| 50 | |||
| 51 | +Return+ : ObjGtkWidget : the same image object or nil if error |
||
| 52 | |||
| 53 | 12 | iri | h2. _gtkImageRst |
| 54 | |||
| 55 | Resets an existing image object to be empty. |
||
| 56 | |||
| 57 | Prototype : *fun [ObjGtkWidget] ObjGtkWidget* |
||
| 58 | |||
| 59 | +Return+ : ObjGtkWidget : the same object or nil if error |
||
| 60 | |||
| 61 | 5 | iri | h2. _gtkImageGetType |
| 62 | |||
| 63 | Returns the type of a image object |
||
| 64 | |||
| 65 | Prototype : *fun [ObjGtkWidget] I* |
||
| 66 | |||
| 67 | +Return+ : I : |
||
| 68 | * SCOL_IMAGE_EMPTY : there is no image displayed by the widget. |
||
| 69 | * SCOL_IMAGE_PIX : the widget contains a pix object (directly from a pix object or from an image file). |
||
| 70 | 1 | iri | * SCOL_IMAGE_STOCK : the widget contains a stock icon name |
| 71 | 5 | iri | * SCOL_IMAGE_PIXANIM : the widget contains an animated pix object (directly from an animated pix object or from an image file). |
| 72 | * SCOL_IMAGE_ICON : the widget contains a named icon. |
||
| 73 | 7 | iri | * nil if an errors occurs or if the type couldn't be unknown |
| 74 | 5 | iri | |
| 75 | 8 | iri | h2. _gtkImageGetContent |
| 76 | |||
| 77 | 9 | iri | Returns the content of an image object. The return depends to the type of the image object. |
| 78 | 8 | iri | |
| 79 | 9 | iri | Prototype : *fun [ObjGtkWidget] [ObjGtkPix S I]* |
| 80 | |||
| 81 | +Return+ : [ObjGtkPix S I] |
||
| 82 | 10 | iri | * ObjGtkPix : a pix object, if the image object has it. Otherwise nil. |
| 83 | 9 | iri | * S : the name of the icon or the stock item; otherwise nil. |
| 84 | * I : the size of the icon or stock item; otherwise nil |
||
| 85 | 8 | iri | |
| 86 | 1 | iri | Return [[Api]] |