SWFMovie
<<<
SWFShape->addFill SWFShape->drawCurve
>>>

8.70 Ming pour Flash
8 Référence des fonctions
 Manuel PHP

Introduction
Pré-requis
Installation
Configuration à l'exécution
Types de ressources
Constantes pré-définies
Classes pré-définies
ming_setcubicthreshold
ming_setscale
ming_useswfversion
SWFAction
SWFBitmap->getHeight
SWFBitmap->getWidth
SWFBitmap
swfbutton_keypress
SWFbutton->addAction
SWFbutton->addShape
SWFbutton->setAction
SWFbutton->setdown
SWFbutton->setHit
SWFbutton->setOver
SWFbutton->setUp
SWFbutton
SWFDisplayItem->addColor
SWFDisplayItem->move
SWFDisplayItem->moveTo
SWFDisplayItem->multColor
SWFDisplayItem->remove
SWFDisplayItem->Rotate
SWFDisplayItem->rotateTo
SWFDisplayItem->scale
SWFDisplayItem->scaleTo
SWFDisplayItem->setDepth
SWFDisplayItem->setName
SWFDisplayItem->setRatio
SWFDisplayItem->skewX
SWFDisplayItem->skewXTo
SWFDisplayItem->skewY
SWFDisplayItem->skewYTo
SWFDisplayItem
SWFFill->moveTo
SWFFill->rotateTo
SWFFill->scaleTo
SWFFill->skewXTo
SWFFill->skewYTo
SWFFill
swffont->getwidth
SWFFont
SWFGradient->addEntry
SWFGradient
SWFMorph->getshape1
SWFMorph->getshape2
SWFMorph
SWFMovie->add
SWFMovie->nextframe
SWFMovie->output
swfmovie->remove
SWFMovie->save
SWFMovie->setbackground
SWFMovie->setdimension
SWFMovie->setframes
SWFMovie->setrate
SWFMovie->streammp3
SWFMovie
->SWFShape->addFill
SWFShape->drawCurve
SWFShape->drawCurveTo
SWFShape->drawLine
SWFShape->drawLineTo
SWFShape->movePen
SWFShape->movePenTo
SWFShape->setLeftFill
SWFShape->setLine
SWFShape->setRightFill
SWFShape
swfsprite->add
SWFSprite->nextframe
SWFSprite->remove
SWFSprite->setframes
SWFSprite
SWFText->addString
SWFText->getWidth
SWFText->moveTo
SWFText->setColor
SWFText->setFont
SWFText->setHeight
SWFText->setSpacing
SWFText
SWFTextField->addstring
SWFTextField->align
SWFTextField->setbounds
SWFTextField->setcolor
SWFTextField->setFont
SWFTextField->setHeight
SWFTextField->setindentation
SWFTextField->setLeftMargin
SWFTextField->setLineSpacing
SWFTextField->setMargins
SWFTextField->setname
SWFTextField->setrightMargin
SWFTextField

8.70.65 SWFShape->addFill()Ajoute un remplissage plein à la forme Flash

[ Exemples avec swfshape.addfill ]   CVS uniquement

SWFFill  SWFShape->addFill ( int   red , int   green , int   blue , int   a ) SWFFill  SWFShape->addFill ( SWFBitmap   bitmap , int   flags ) SWFFill  SWFShape->addFill ( SWFGradient   gradient , int   flags )
Attention

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 remplissage plein à la forme. SWFShape->addFill accepte trois différents types d'arguments.

red , green , blue est une couleur (format RGB). Le dernier paramètre a est optionnel.

L'argument bitmap est un objet SWFBitmap . Le paramètre flags peut être l'un des suivants : SWFFILL_CLIPPED_BITMAP ou SWFFILL_TILED_BITMAP. Par défaut, c'est SWFFILL_TILED_BITMAP pour SWFBitmap et SWFFILL_LINEAR_GRADIENT pour SWFGradient.

L'argument gradient est un objet SWFGradient . L'argument flags peut alors prendre l'une des valeurs suivantes : SWFFILL_RADIAL_GRADIENT ou SWFFILL_LINEAR_GRADIENT. Par défaut, c'est SWFFILL_LINEAR_GRADIENT.

SWFShape->addFill retourne un objet swffill à utiliser avec swfshape->setleftfill , et SWFShape->setRightFill décrite un peu plus loin.

Ceci est un exemple simple qui affiche un cadre sur une bitmap. Ah, il y a un petit bogue dans le lecteur Flash : il ne semble pas faire grand cas de la transformation de la seconde forme en morphing. Suivant les specs, la bitmap devrait s'étirer avec la forme dans cet exemple...
Exemple avec SWFShape->addFill

<?php

$p
= new SWFMorph();

$b = new SWFBitmap(file_get_contents("alphafill.jpg"));
// utilisez vos propres bitmaps!
$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);

// ces déplacements n'ont aucun effet
$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();
?>

Voir aussi SWFShape->setLeftFill et SWFShape->setRightFill .

<< SWFShape->addFill >>
SWFMovie Ming pour Flash SWFShape->drawCurve