-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathimagesetstyle.xml
More file actions
122 lines (116 loc) · 3.79 KB
/
imagesetstyle.xml
File metadata and controls
122 lines (116 loc) · 3.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 9960a09a5705102bf4dd0ce63e03d9ec716d0015 Maintainer: PhilDaiguille Status: ready -->
<!-- Reviewed: yes -->
<refentry xml:id="function.imagesetstyle" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>imagesetstyle</refname>
<refpurpose>Configura el estilo para el dibujo de líneas</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>imagesetstyle</methodname>
<methodparam><type>GdImage</type><parameter>image</parameter></methodparam>
<methodparam><type>array</type><parameter>style</parameter></methodparam>
</methodsynopsis>
<para>
<function>imagesetstyle</function> permite seleccionar el estilo a utilizar
al dibujar líneas (como con las funciones <function>imageline</function>
y <function>imagepolygon</function>) al utilizar la
color especial <constant>IMG_COLOR_STYLED</constant> o bien al
dibujar líneas con la color <constant>IMG_COLOR_STYLEDBRUSHED</constant>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&gd.image.description;
<varlistentry>
<term><parameter>style</parameter></term>
<listitem>
<para>
Un array de colores de píxeles. Puede utilizarse la constante
<constant>IMG_COLOR_TRANSPARENT</constant> para añadir
un píxel transparente.
Tenga en cuenta que <parameter>style</parameter> no debe ser un array <type>array</type> vacío.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
El siguiente ejemplo dibuja una línea punteada desde la esquina superior
izquierda hacia la esquina inferior derecha de la imagen:
<example>
<title>Ejemplo para <function>imagesetstyle</function></title>
<programlisting role="php">
<![CDATA[
<?php
header("Content-type: image/jpeg");
$im = imagecreatetruecolor(100, 100);
$w = imagecolorallocate($im, 255, 255, 255);
$red = imagecolorallocate($im, 255, 0, 0);
/* Dibuja una línea punteada de 5 píxeles rojos, 5 píxeles blancos */
$style = array($red, $red, $red, $red, $red, $w, $w, $w, $w, $w);
imagesetstyle($im, $style);
imageline($im, 0, 0, 100, 100, IMG_COLOR_STYLED);
/* Dibuja una línea con smileys, utilizando imagesetbrush() y imagesetstyle */
$style = array($w, $w, $w, $w, $w, $w, $w, $w, $w, $w, $w, $w, $red);
imagesetstyle($im, $style);
$brush = imagecreatefrompng("http://www.libpng.org/pub/png/images/smile.happy.png");
$w2 = imagecolorallocate($brush, 255, 255, 255);
imagecolortransparent($brush, $w2);
imagesetbrush($im, $brush);
imageline($im, 100, 0, 0, 100, IMG_COLOR_STYLEDBRUSHED);
imagejpeg($im);
?>
]]>
</programlisting>
&example.outputs.similar;
<mediaobject>
<alt>Visualización del ejemplo: imagesetstyle()</alt>
<imageobject>
<imagedata fileref="en/reference/image/figures/imagesetstyle.jpg"/>
</imageobject>
</mediaobject>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><function>imagesetbrush</function></member>
<member><function>imageline</function></member>
</simplelist>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->