mirror of
https://github.com/php/doc-es.git
synced 2026-04-27 17:14:09 +02:00
fa87e1c4b5
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@323312 c90b9560-bf6c-de11-be94-00142212c4b1
156 lines
4.9 KiB
XML
156 lines
4.9 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 0d604bbc9d3b741d53e7fac26f5b24c306751e9a Maintainer: seros Status: ready -->
|
|
<refentry xml:id="swfshape.addfill" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>SWFShape::addFill</refname>
|
|
<refpurpose>Añade un relleno sólido a la forma</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>SWFFill</type><methodname>SWFShape::addFill</methodname>
|
|
<methodparam><type>int</type><parameter>red</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>green</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>blue</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>alpha</parameter><initializer>255</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<methodsynopsis>
|
|
<type>SWFFill</type><methodname>addFill</methodname>
|
|
<methodparam><type>SWFBitmap</type><parameter>bitmap</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<methodsynopsis>
|
|
<type>SWFFill</type><methodname>addFill</methodname>
|
|
<methodparam><type>SWFGradient</type><parameter>gradient</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam>
|
|
</methodsynopsis>
|
|
&warn.experimental.func;
|
|
<para>
|
|
<function>SWFShape::addFill</function> añade un relleno sólido a la lista de formas
|
|
de los estilos de relleno. <function>SWFShape::addFill</function> acepta tres tipos
|
|
diferentes de argumentos.
|
|
</para>
|
|
<para>
|
|
<parameter>red</parameter>, <parameter>green</parameter>, <parameter>blue</parameter>
|
|
es un color (modo RGB).
|
|
</para>
|
|
<para>
|
|
El argumento <parameter>bitmap</parameter> es un objeto <function>SWFBitmap</function>.
|
|
El argumento <parameter>flags</parameter> puede ser uno
|
|
de los valores siguientes: SWFFILL_CLIPPED_BITMAP, SWFFILL_TILED_BITMAP,
|
|
SWFFILL_LINEAR_GRADIENT o SWFFILL_RADIAL_GRADIENT. Por omisión es
|
|
SWFFILL_TILED_BITMAP para SWFBitmap y SWFFILL_LINEAR_GRADIENT para
|
|
SWFGradient.
|
|
</para>
|
|
<para>
|
|
El argumento <parameter>gradient</parameter> es un objeto <function>SWFGradient</function>.
|
|
El argumento flags puede ser uno de los valores siguientes:
|
|
SWFFILL_RADIAL_GRADIENT o SWFFILL_LINEAR_GRADIENT. Por omisión es
|
|
SWFFILL_LINEAR_GRADIENT. Estoy seguro de esto. De verdad.
|
|
</para>
|
|
<para>
|
|
<function>SWFShape::addFill</function> devuelve un objeto <function>SWFFill</function>
|
|
para usarlo con las funciones <function>SWFShape::setLeftFill</function>
|
|
y <function>SWFShape->setRightFill</function>
|
|
descritas después.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
Este sencillo ejemplo dibujará un fotograma en un mapa de bits. Ah, hay otro error en
|
|
el reproductor de flash- parece que no valora la segunda transformación del mapa de bits
|
|
de la forma en un morph. Por si acaso, el mapa de bits debería extenderse
|
|
con la forma en este ejemplo...
|
|
<example>
|
|
<title>Ejemplo de <function>SWFShape::addFill</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
$p = new SWFMorph();
|
|
|
|
$b = new SWFBitmap(file_get_contents("alphafill.jpg"));
|
|
// use su propio mapa de bits
|
|
$width = $b->getWidth();
|
|
$height = $b->getHeight();
|
|
|
|
$s = $p->getShape1();
|
|
$f = $s->addFill($b, SWFFILL_TILED_BITMAP);
|
|
$f->moveTo(-$width/2, -$height/4);
|
|
$f->scaleTo(1.0, 0.5);
|
|
$s->setLeftFill($f);
|
|
$s->movePenTo(-$width/2, -$height/4);
|
|
$s->drawLine($width, 0);
|
|
$s->drawLine(0, $height/2);
|
|
$s->drawLine(-$width, 0);
|
|
$s->drawLine(0, -$height/2);
|
|
|
|
$s = $p->getShape2();
|
|
$f = $s->addFill($b, SWFFILL_TILED_BITMAP);
|
|
|
|
// ¡estos dos no tienen efecto!
|
|
$f->moveTo(-$width/4, -$height/2);
|
|
$f->scaleTo(0.5, 1.0);
|
|
|
|
$s->setLeftFill($f);
|
|
$s->movePenTo(-$width/4, -$height/2);
|
|
$s->drawLine($width/2, 0);
|
|
$s->drawLine(0, $height);
|
|
$s->drawLine(-$width/2, 0);
|
|
$s->drawLine(0, -$height);
|
|
|
|
$m = new SWFMovie();
|
|
$m->setDimension($width, $height);
|
|
$i = $m->add($p);
|
|
$i->moveTo($width/2, $height/2);
|
|
|
|
for ($n=0; $n<1.001; $n+=0.03) {
|
|
$i->setRatio($n);
|
|
$m->nextFrame();
|
|
}
|
|
|
|
header('Content-type: application/x-shockwave-flash');
|
|
$m->output();
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>SWFShape::setLeftFill</function></member>
|
|
<member><function>SWFShape::setRightFill</function></member>
|
|
</simplelist>
|
|
</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
|
|
-->
|