Project

General

Profile

Images » History » Version 10

iri, 03/31/2011 10:35 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 5 iri
h2. _gtkImageGetType
33
34
Returns the type of a image object
35
36
Prototype : *fun [ObjGtkWidget] I*
37
38
+Return+ : I :
39
* SCOL_IMAGE_EMPTY : there is no image displayed by the widget.
40
* SCOL_IMAGE_PIX : the widget contains a pix object (directly from a pix object or from an image file).
41 1 iri
* SCOL_IMAGE_STOCK : the widget contains a stock icon name
42 5 iri
* SCOL_IMAGE_PIXANIM : the widget contains an animated pix object (directly from an animated pix object or from an image file).
43
* SCOL_IMAGE_ICON : the widget contains a named icon.
44 7 iri
* nil if an errors occurs or if the type couldn't be unknown
45 5 iri
46 8 iri
h2. _gtkImageGetContent
47
48 9 iri
Returns the content of an image object. The return depends to the type of the image object.
49 8 iri
50 9 iri
Prototype : *fun [ObjGtkWidget] [ObjGtkPix S I]*
51
52
+Return+ : [ObjGtkPix S I]
53 10 iri
* ObjGtkPix : a pix object, if the image object has it. Otherwise nil.
54 9 iri
* S : the name of the icon or the stock item; otherwise nil.
55
* I : the size of the icon or stock item; otherwise nil
56 8 iri
57 1 iri
Return [[Api]]