reference/image/functions/imagexbm.xml
62126c55f1c6ed444043e7272c4f9e233818a44b
...
...
@@ -1,22 +1,29 @@
1
-
<?xml version="1.0" encoding="UTF-8"?>
1
+
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
3
<refentry xml:id="function.imagexbm" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>imagexbm</refname>
6
-
<refpurpose>Output XBM image to browser or file</refpurpose>
6
+
<refpurpose>Output an XBM image to browser or file</refpurpose>
7
7
</refnamediv>
8
8
<refsect1 role="description">
9
9
&reftitle.description;
10
10
<methodsynopsis>
11
11
<type>bool</type><methodname>imagexbm</methodname>
12
-
<methodparam><type>resource</type><parameter>image</parameter></methodparam>
13
-
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
14
-
<methodparam choice="opt"><type>int</type><parameter>foreground</parameter></methodparam>
12
+
<methodparam><type>GdImage</type><parameter>image</parameter></methodparam>
13
+
<methodparam><type class="union"><type>string</type><type>null</type></type><parameter>filename</parameter></methodparam>
14
+
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>foreground_color</parameter><initializer>&null;</initializer></methodparam>
15
15
</methodsynopsis>
16
16
<para>
17
17
Outputs or save an <acronym>XBM</acronym> version of the given
18
18
<parameter>image</parameter>.
19
19
</para>
20
+
<note>
21
+
<simpara>
22
+
<function>imagexbm</function> doesn't apply any padding, so the image width
23
+
has to be a multiple of 8.
24
+
This restriction does no longer apply as of PHP 7.0.9.
25
+
</simpara>
26
+
</note>
20
27
</refsect1>
21
28
<refsect1 role="parameters">
22
29
&reftitle.parameters;
...
...
@@ -26,16 +33,24 @@
26
33
<varlistentry>
27
34
<term><parameter>filename</parameter></term>
28
35
<listitem>
29
-
<para>&gd.image.path;</para>
36
+
<para>The path to save the file to, given as &string;. If &null;, the raw image stream will be output directly.</para>
37
+
<para>
38
+
The <parameter>filename</parameter> (without the .xbm extension) is also
39
+
used for the C identifiers of the <acronym>XBM</acronym>, whereby non
40
+
alphanumeric characters of the current locale are substituted by
41
+
underscores. If <parameter>filename</parameter> is set to &null;,
42
+
<literal>image</literal> is used to build the C identifiers.
43
+
</para>
30
44
</listitem>
31
45
</varlistentry>
32
46
<varlistentry>
33
-
<term><parameter>foreground</parameter></term>
47
+
<term><parameter>foreground_color</parameter></term>
34
48
<listitem>
35
49
<para>
36
50
You can set the foreground color with this parameter by setting an
37
51
identifier obtained from <function>imagecolorallocate</function>.
38
-
The default foreground color is black.
52
+
The default foreground color is black. All other colors are treated as
53
+
background.
39
54
</para>
40
55
</listitem>
41
56
</varlistentry>
...
...
@@ -47,7 +62,38 @@
47
62
<para>
48
63
&return.success;
49
64
</para>
65
+
&gd.return.trueonerror;
66
+
</refsect1>
67
+

68
+
<refsect1 role="changelog">
69
+
&reftitle.changelog;
70
+
<informaltable>
71
+
<tgroup cols="2">
72
+
<thead>
73
+
<row>
74
+
<entry>&Version;</entry>
75
+
<entry>&Description;</entry>
76
+
</row>
77
+
</thead>
78
+
<tbody>
79
+
&gd.changelog.image-param;
80
+
<row>
81
+
<entry>8.0.0</entry>
82
+
<entry>
83
+
<parameter>foreground_color</parameter> is now nullable.
84
+
</entry>
85
+
</row>
86
+
<row>
87
+
<entry>8.0.0</entry>
88
+
<entry>
89
+
The fourth parameter, which was unused, has been removed.
90
+
</entry>
91
+
</row>
92
+
</tbody>
93
+
</tgroup>
94
+
</informaltable>
50
95
</refsect1>
96
+

51
97
<refsect1 role="examples">
52
98
&reftitle.examples;
53
99
<para>
...
...
@@ -96,12 +142,8 @@ imagedestroy($im);
96
142
</example>
97
143
</para>
98
144
</refsect1>
99
-
<refsect1 role="notes">
100
-
&reftitle.notes;
101
-
&note.bundled.gd;
102
-
</refsect1>
103
-
</refentry>
104
145

146
+
</refentry>
105
147
<!-- Keep this comment at the end of the file
106
148
Local variables:
107
149
mode: sgml
108
150