1
0
mirror of https://github.com/php/doc-es.git synced 2026-03-24 07:22:16 +01:00
Files
archived-doc-es/reference/imagick/imagickdraw/pushpattern.xml
Sergey Panteleev 333b465e4a Update to English
2021-08-30 15:48:43 -05:00

166 lines
4.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 668b6fc28891062b1c96202009ccb70b7147740d Maintainer: seros Status: ready -->
<!-- Reviewed: no Maintainer: seros -->
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="imagickdraw.pushpattern">
<refnamediv>
<refname>ImagickDraw::pushPattern</refname>
<refpurpose>Indica que los comandos subsiguientes hasta un comando ImagickDraw::opPattern() comprenden la definición de un patrón nominado</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>bool</type><methodname>ImagickDraw::pushPattern</methodname>
<methodparam><type>string</type><parameter>pattern_id</parameter></methodparam>
<methodparam><type>float</type><parameter>x</parameter></methodparam>
<methodparam><type>float</type><parameter>y</parameter></methodparam>
<methodparam><type>float</type><parameter>width</parameter></methodparam>
<methodparam><type>float</type><parameter>height</parameter></methodparam>
</methodsynopsis>
&warn.undocumented.func;
<para>
Indica que los comandos subsiguientes hasta un comando DrawPopPattern()
comprenden la definición de un patrón nominado. Al espacio del patrón se le asigna
las coordenadas de la esquina superior izquierda, un ancho y alto, y se convierte en su propio
espacio de dibujo. Cualquier cosa que se pueda dibujar se puede usar en una definición de
patrón. Los patrones nominados se pueden usar como definiciones de contorno o pincel.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>pattern_id</parameter></term>
<listitem>
<para>
el id del patrón
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>x</parameter></term>
<listitem>
<para>
coordenada x de la esquina superior izquierda
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>y</parameter></term>
<listitem>
<para>
coordenada y de la esquina superior izquierda
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>width</parameter></term>
<listitem>
<para>
ancho del patrón
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>height</parameter></term>
<listitem>
<para>
alto del patrón
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Ejemplo de <function>ImagickDraw::pushPattern</function></title>
<programlisting role="php">
<![CDATA[
<?php
function pushPattern($strokeColor, $fillColor, $backgroundColor) {
$draw = new \ImagickDraw();
$draw->setStrokeColor($strokeColor);
$draw->setFillColor($fillColor);
$draw->setStrokeWidth(1);
$draw->setStrokeOpacity(1);
$draw->setStrokeColor($strokeColor);
$draw->setFillColor($fillColor);
$draw->setStrokeWidth(1);
$draw->pushPattern("MyFirstPattern", 0, 0, 50, 50);
for ($x = 0; $x < 50; $x += 10) {
for ($y = 0; $y < 50; $y += 5) {
$positionX = $x + (($y / 5) % 5);
$draw->rectangle($positionX, $y, $positionX + 5, $y + 5);
}
}
$draw->popPattern();
$draw->setFillOpacity(0);
$draw->rectangle(100, 100, 400, 400);
$draw->setFillOpacity(1);
$draw->setFillOpacity(1);
$draw->push();
$draw->setFillPatternURL('#MyFirstPattern');
$draw->setFillColor('yellow');
$draw->rectangle(100, 100, 400, 400);
$draw->pop();
$imagick = new \Imagick();
$imagick->newImage(500, 500, $backgroundColor);
$imagick->setImageFormat("png");
$imagick->drawImage($draw);
header("Content-Type: image/png");
echo $imagick->getImageBlob();
}
?>
]]>
</programlisting>
</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
-->