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

search for in the

SWFShape->__construct> <SWFShape
Last updated: Fri, 14 Aug 2009

view this page in

SWFShape->addFill

(PHP 4 >= 4.0.5)

SWFShape->addFillAjoute un motif solide à la forme

Description

SWFFill addFill ( int $red , int $green , int $blue [, int $alpha= 255 ] )
SWFFill addFill ( SWFBitmap $bitmap [, int $flags ] )
SWFFill addFill ( SWFGradient $gradient [, int $flags ] )
Avertissement

Cette fonction est EXPERIMENTALE. Cela signifie que le comportement de cette fonction, son nom et, concrètement, TOUT ce qui est documenté ici peut changer dans un futur proche, SANS PREAVIS ! Soyez-en conscient, et utilisez cette fonction à vos risques et périls.

SWFShape->addFill() ajoute un motif solide à la liste des styles de la forme. SWFShape->addFill() accepte trois types différents d'arguments.

red , green , blue est une couleur (en mode RVB). Le dernier paramètre a est optionnel.

L'argument bitmap est un objet SWFBitmap(). L'argument flags peut être une valeur parmi : SWFFILL_CLIPPED_BITMAP, SWFFILL_TILED_BITMAP, SWFFILL_LINEAR_GRADIENT ou SWFFILL_RADIAL_GRADIENT. Par défaut, vaut SWFFILL_TILED_BITMAP pour SWFBitmap et SWFFILL_LINEAR_GRADIENT pour SWFGradient.

L'argument gradient est un objet SWFGradient(). L'argument flags peut être une valeur parmi : SWFFILL_RADIAL_GRADIENT ou SWFFILL_LINEAR_GRADIENT. Par défaut, vaut SWFFILL_LINEAR_GRADIENT.

SWFShape->addFill() retourne un objet SWFFill() pour l'utiliser avec la fonction SWFShape->setLeftFill() et la fonction SWFShape->setRightFill().

Exemples

Cet exemple trace une frame dans un bitmap.

Exemple #1 Exemple avec SWFShape->addFill()

<?php

$p 
= new SWFMorph();

$b = new SWFBitmap(file_get_contents("alphafill.jpg"));
// utilisez votre propre bitmap
$width $b->getWidth();
$height $b->getHeight();

$s $p->getShape1();
$f $s->addFill($bSWFFILL_TILED_BITMAP);
$f->moveTo(-$width/2, -$height/4);
$f->scaleTo(1.00.5);
$s->setLeftFill($f);
$s->movePenTo(-$width/2, -$height/4);
$s->drawLine($width0);
$s->drawLine(0$height/2);
$s->drawLine(-$width0);
$s->drawLine(0, -$height/2);

$s $p->getShape2();
$f $s->addFill($bSWFFILL_TILED_BITMAP);

// Ceci n'a pas d'effet !
$f->moveTo(-$width/4, -$height/2);
$f->scaleTo(0.51.0);

$s->setLeftFill($f);
$s->movePenTo(-$width/4, -$height/2);
$s->drawLine($width/20);
$s->drawLine(0$height);
$s->drawLine(-$width/20);
$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();
?>



add a note add a note User Contributed Notes
SWFShape->addFill
There are no user contributed notes for this page.

SWFShape->__construct> <SWFShape
Last updated: Fri, 14 Aug 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites