downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

SWFShape::setRightFill> <SWFShape->setLeftFill
[edit] Last updated: Fri, 24 May 2013

view this page in

SWFShape::setLine

(PHP 4 >= 4.0.5)

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

Descripción

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

Esta función ha sido declarada EXPERIMENTAL. Su comportamiento, su nombre y la documentación que le acompaña puede cambiar sin previo aviso en futuras versiones de PHP. Use esta función bajo su propio riesgo.

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 SWFShape::setLine - [1 notes]
up
0
Brad
1 year 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.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites