Project

General

Profile

Images » History » Version 11

iri, 03/31/2011 11:26 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 5 iri
h2. _gtkImageGetType
54
55
Returns the type of a image object
56
57
Prototype : *fun [ObjGtkWidget] I*
58
59
+Return+ : I :
60
* SCOL_IMAGE_EMPTY : there is no image displayed by the widget.
61
* SCOL_IMAGE_PIX : the widget contains a pix object (directly from a pix object or from an image file).
62 1 iri
* SCOL_IMAGE_STOCK : the widget contains a stock icon name
63 5 iri
* SCOL_IMAGE_PIXANIM : the widget contains an animated pix object (directly from an animated pix object or from an image file).
64
* SCOL_IMAGE_ICON : the widget contains a named icon.
65 7 iri
* nil if an errors occurs or if the type couldn't be unknown
66 5 iri
67 8 iri
h2. _gtkImageGetContent
68
69 9 iri
Returns the content of an image object. The return depends to the type of the image object.
70 8 iri
71 9 iri
Prototype : *fun [ObjGtkWidget] [ObjGtkPix S I]*
72
73
+Return+ : [ObjGtkPix S I]
74 10 iri
* ObjGtkPix : a pix object, if the image object has it. Otherwise nil.
75 9 iri
* S : the name of the icon or the stock item; otherwise nil.
76
* I : the size of the icon or stock item; otherwise nil
77 8 iri
78 1 iri
Return [[Api]]