mirror of
https://github.com/php/doc-es.git
synced 2026-03-26 00:12:06 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@322693 c90b9560-bf6c-de11-be94-00142212c4b1
165 lines
4.0 KiB
XML
165 lines
4.0 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 0d604bbc9d3b741d53e7fac26f5b24c306751e9a Maintainer: seros Status: ready -->
|
|
<refentry xml:id="swfbitmap.construct" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>SWFBitmap::__construct</refname>
|
|
<refpurpose>Carga un objeto de mapa de bits</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<methodname>SWFBitmap::__construct</methodname>
|
|
<methodparam><type>mixed</type><parameter>file</parameter></methodparam>
|
|
<methodparam choice="opt"><type>mixed</type><parameter>alphafile</parameter></methodparam>
|
|
</methodsynopsis>
|
|
&warn.experimental.func;
|
|
<para>
|
|
Crea un nuevo objeto <classname>SWFBitmap</classname> desde el
|
|
archivo dado por <parameter>file</parameter>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
Para amabos parámetros, se puede proporcionar un puntero a archivo devuelto por
|
|
<function>fopen</function> o la información de imagen, como cadena binaria.
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>file</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
</para>
|
|
<note>
|
|
<para>
|
|
Sólo podemos tratar con jpegs de línea base (fotograma 0), ¡sin línea base optimizada ni
|
|
jpegs de escaneo progresivo!
|
|
</para>
|
|
</note>
|
|
<para>
|
|
No se pueden importar imágenes png directamente, aunque se tiene que usar la utilidad
|
|
png2dbl para hacer un archivo dbl ("define bits lossless") desde el png.
|
|
La razón de esto es que no quiero una dependencia de la biblioteca png
|
|
en ming- autoconf debería resolver esto, pero todavía no está configurado.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>alphafile</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Un archivo MSK a usar como máscara alfa para una imagen JPEG.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Importar un archivo DBL</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$s = new SWFShape();
|
|
$f = $s->addFill(new SWFBitmap(file_get_contents("image.dbl")));
|
|
$s->setRightFill($f);
|
|
|
|
$s->drawLine(32, 0);
|
|
$s->drawLine(0, 32);
|
|
$s->drawLine(-32, 0);
|
|
$s->drawLine(0, -32);
|
|
|
|
$m = new SWFMovie();
|
|
$m->setDimension(32, 32);
|
|
$m->add($s);
|
|
|
|
header('Content-type: application/x-shockwave-flash');
|
|
$m->output();
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Usar una máscara alfa</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
$s = new SWFShape();
|
|
|
|
// archivo .msk generado con la utilidad "gif2mask"
|
|
$f = $s->addFill(new SWFBitmap(file_get_contents("alphafill.jpg"), file_get_contents("alphafill.msk")));
|
|
$s->setRightFill($f);
|
|
|
|
$s->drawLine(640, 0);
|
|
$s->drawLine(0, 480);
|
|
$s->drawLine(-640, 0);
|
|
$s->drawLine(0, -480);
|
|
|
|
$c = new SWFShape();
|
|
$c->setRightFill($c->addFill(0x99, 0x99, 0x99));
|
|
$c->drawLine(40, 0);
|
|
$c->drawLine(0, 40);
|
|
$c->drawLine(-40, 0);
|
|
$c->drawLine(0, -40);
|
|
|
|
$m = new SWFMovie();
|
|
$m->setDimension(640, 480);
|
|
$m->setBackground(0xcc, 0xcc, 0xcc);
|
|
|
|
// dibujar un fondo de tablero de ajedrez
|
|
for ($y=0; $y<480; $y+=40) {
|
|
for ($x=0; $x<640; $x+=80) {
|
|
$i = $m->add($c);
|
|
$i->moveTo($x, $y);
|
|
}
|
|
|
|
$y+=40;
|
|
|
|
for ($x=40; $x<640; $x+=80) {
|
|
$i = $m->add($c);
|
|
$i->moveTo($x, $y);
|
|
}
|
|
}
|
|
|
|
$m->add($s);
|
|
|
|
header('Content-type: application/x-shockwave-flash');
|
|
$m->output();
|
|
?>
|
|
]]>
|
|
</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
|
|
-->
|