PHP Velho Oeste 2024

SWFShape::setLine

(PHP 5 < 5.3.0, PECL ming SVN)

SWFShape::setLineEstablece el estilo de línea de la forma

Descripción

SWFShape::setLine ( SWFShape $shape ) : void
setLine ( int $width , int $red , int $green , int $blue [, int $a ] ) : void
Advertencia

Esta función ha sido declarada EXPERIMENTAL. Su funcionamiento, nombre y la documentación que le acompaña puede cambiar sin previo aviso en futuras versiones de PHP. Utilícela bajo su propia responsabilidad.

swfshape::setline() establece el estilo de línea de la forma. width es el ancho de línea. Si width es 0, es estilo de línea se elimina (entonces se ignoran todos los demás argumentos). Si width > 0, el color de la línea se establece a red, green, blue. El último parámetro, a, es opcional.

De deben declarar todos los estilos de línea antes de usarlos (véase el ejemplo).

Valores devueltos

No devuelve ningún valor.

Ejemplos

Este sencillo ejemplo dibujará un gran "!#%*@" en divertidos colores y estilo elegante.

Ejemplo #1 Ejemplo de swfshape::setline()

<?php
$s 
= new SWFShape();
$f1 $s->addFill(0xff00);
$f2 $s->addFill(0xff0x7f0);
$f3 $s->addFill(0xff0xff0);
$f4 $s->addFill(00xff0);
$f5 $s->addFill(000xff);

// error: se deben declarar todos los estilo de línea antes de usarlos
$s->setLine(400x7f00);
$s->setLine(400x7f0x3f0);
$s->setLine(400x7f0x7f0);
$s->setLine(4000x7f0);
$s->setLine(40000x7f);

$f = new SWFFont('Techno.fdb');

$s->setRightFill($f1);
$s->setLine(400x7f00);
$s->drawGlyph($f'!');
$s->movePen($f->getWidth('!'), 0);

$s->setRightFill($f2);
$s->setLine(400x7f0x3f0);
$s->drawGlyph($f'#');
$s->movePen($f->getWidth('#'), 0);

$s->setRightFill($f3);
$s->setLine(400x7f0x7f0);
$s->drawGlyph($f'%');
$s->movePen($f->getWidth('%'), 0);

$s->setRightFill($f4);
$s->setLine(4000x7f0);
$s->drawGlyph($f'*');
$s->movePen($f->getWidth('*'), 0);

$s->setRightFill($f5);
$s->setLine(40000x7f);
$s->drawGlyph($f'@');

$m = new SWFMovie();
$m->setDimension(3000,2000);
$m->setRate(12.0);
$i $m->add($s);
$i->moveTo(1500-$f->getWidth("!#%*@")/21000+$f->getAscent()/2);

header('Content-type: application/x-shockwave-flash');
$m->output();
?>

Valores devueltos

No devuelve ningún valor.

add a note add a note

User Contributed Notes 1 note

up
0
Brad
12 years ago
Just wanted to point out that a $width value of 0 does _not_ prevent the line from being drawn.  It causes a non-scaling, single pixel line to be drawn.  This is analogous to the way this is handled in ActionScript (see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/Graphics.html#lineStyle%28%29)

If you do not want a line to be drawn at all, use NAN for $width instead of zero.
To Top