mirror of
https://github.com/php/doc-es.git
synced 2026-03-24 07:22:16 +01:00
159 lines
4.1 KiB
XML
159 lines
4.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: 9960a09a5705102bf4dd0ce63e03d9ec716d0015 Maintainer: PhilDaiguille Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
|
|
<refentry xml:id="function.imagerectangle" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>imagerectangle</refname>
|
|
<refpurpose>Dibuja un rectángulo</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>imagerectangle</methodname>
|
|
<methodparam><type>GdImage</type><parameter>image</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>x1</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>y1</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>x2</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>y2</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>color</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>imagerectangle</function> dibuja un rectángulo en las coordenadas
|
|
especificadas.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
&gd.image.description;
|
|
<varlistentry>
|
|
<term><parameter>x1</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
X: coordenada de la esquina superior izquierda.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>y1</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Y: coordenada de la esquina superior izquierda.
|
|
0, 0 es la esquina superior izquierda de la imagen.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>x2</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
X: coordenada del punto inferior derecho.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>y2</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Y: coordenada del punto inferior derecho.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>color</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
&gd.identifier.color;
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.success;
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
&gd.changelog.image-param;
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Ejemplo con <function>imagerectangle</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// Creación de una imagen de 200 x 200 píxeles
|
|
$canvas = imagecreatetruecolor(200, 200);
|
|
|
|
// Asigna los colores
|
|
$pink = imagecolorallocate($canvas, 255, 105, 180);
|
|
$white = imagecolorallocate($canvas, 255, 255, 255);
|
|
$green = imagecolorallocate($canvas, 132, 135, 28);
|
|
|
|
// Dibuja 3 rectángulos, cada uno con su color
|
|
imagerectangle($canvas, 50, 50, 150, 150, $pink);
|
|
imagerectangle($canvas, 45, 60, 120, 100, $white);
|
|
imagerectangle($canvas, 100, 120, 75, 160, $green);
|
|
|
|
// Visualización
|
|
header('Content-Type: image/jpeg');
|
|
imagejpeg($canvas);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<mediaobject>
|
|
<alt>Visualización del ejemplo: imagerectangle()</alt>
|
|
<imageobject>
|
|
<imagedata fileref="en/reference/image/figures/imagerectangle.jpg"/>
|
|
</imageobject>
|
|
</mediaobject>
|
|
</example>
|
|
</para>
|
|
</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
|
|
-->
|