<HTML ><HEAD ><TITLE >SWFShape->addFill</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK REL="HOME" TITLE="PHP Manual" HREF="index.html"><LINK REL="UP" TITLE="Ming functions for Flash" HREF="ref.ming.html"><LINK REL="PREVIOUS" TITLE="SWFMovie" HREF="function.swfmovie.html"><LINK REL="NEXT" TITLE="SWFShape->drawCurve" HREF="function.swfshape.drawcurve.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=ISO-8859-1"></HEAD ><BODY CLASS="refentry" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >PHP Manual</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.swfmovie.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.swfshape.drawcurve.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.swfshape.addfill" ></A >SWFShape->addFill</H1 ><DIV CLASS="refnamediv" ><A NAME="AEN54249" ></A ><P > (no version information, might be only in CVS)</P >SWFShape->addFill -- Adds a solid fill to the shape.</DIV ><DIV CLASS="refsect1" ><A NAME="AEN54252" ></A ><H2 >Description</H2 >void <B CLASS="methodname" >swfshape->addfill</B > ( int red, int green, int blue [, int a])<BR ></BR ><DIV CLASS="warning" ><P ></P ><TABLE CLASS="warning" BORDER="1" WIDTH="100%" ><TR ><TD ALIGN="CENTER" ><B >Warning</B ></TD ></TR ><TR ><TD ALIGN="LEFT" ><P >This function is <SPAN CLASS="emphasis" ><I CLASS="emphasis" >EXPERIMENTAL</I ></SPAN >. The behaviour of this function, the name of this function, and anything else documented about this function may change without notice in a future release of PHP. Use this function at your own risk.</P ></TD ></TR ></TABLE ></DIV >void <B CLASS="methodname" >swfshape->addfill</B > ( SWFbitmap bitmap [, int flags])<BR ></BR ><DIV CLASS="warning" ><P ></P ><TABLE CLASS="warning" BORDER="1" WIDTH="100%" ><TR ><TD ALIGN="CENTER" ><B >Warning</B ></TD ></TR ><TR ><TD ALIGN="LEFT" ><P >This function is <SPAN CLASS="emphasis" ><I CLASS="emphasis" >EXPERIMENTAL</I ></SPAN >. The behaviour of this function, the name of this function, and anything else documented about this function may change without notice in a future release of PHP. Use this function at your own risk.</P ></TD ></TR ></TABLE ></DIV >void <B CLASS="methodname" >swfshape->addfill</B > ( SWFGradient gradient [, int flags])<BR ></BR ><DIV CLASS="warning" ><P ></P ><TABLE CLASS="warning" BORDER="1" WIDTH="100%" ><TR ><TD ALIGN="CENTER" ><B >Warning</B ></TD ></TR ><TR ><TD ALIGN="LEFT" ><P >This function is <SPAN CLASS="emphasis" ><I CLASS="emphasis" >EXPERIMENTAL</I ></SPAN >. The behaviour of this function, the name of this function, and anything else documented about this function may change without notice in a future release of PHP. Use this function at your own risk.</P ></TD ></TR ></TABLE ></DIV ><P > <B CLASS="function" >swfshape->addfill()</B > adds a solid fill to the shape's list of fill styles. <B CLASS="function" >swfshape->addfill()</B > accepts three different types of arguments. </P ><P > <TT CLASS="parameter" ><I >red</I ></TT >, <TT CLASS="parameter" ><I >green</I ></TT >, <TT CLASS="parameter" ><I >blue</I ></TT > is a color (RGB mode). Last parameter <TT CLASS="parameter" ><I >a</I ></TT > is optional. </P ><P > The <TT CLASS="parameter" ><I >bitmap</I ></TT > argument is an <A HREF="function.swfbitmap.html" ><B CLASS="function" >swfbitmap()</B ></A > object. The <TT CLASS="parameter" ><I >flags</I ></TT > argument can be one of the following values : SWFFILL_CLIPPED_BITMAP or SWFFILL_TILED_BITMAP. Default is SWFFILL_TILED_BITMAP. I think. </P ><P > The <TT CLASS="parameter" ><I >gradient</I ></TT > argument is an <A HREF="function.swfgradient.html" ><B CLASS="function" >swfgradient()</B ></A > object. The flags argument can be one of the following values : SWFFILL_RADIAL_GRADIENT or SWFFILL_LINEAR_GRADIENT. Default is SWFFILL_LINEAR_GRADIENT. I'm sure about this one. Really. </P ><P > <B CLASS="function" >swfshape->addfill()</B > returns an <A HREF="function.swffill.html" ><B CLASS="function" >swffill()</B ></A > object for use with the <B CLASS="function" >swfshape->setleftfill()</B > and <B CLASS="function" >swfshape->setrightfill()</B > functions described below. </P ><P > See also <B CLASS="function" >swfshape->setleftfill()</B > and <B CLASS="function" >swfshape->setrightfill()</B >. </P ><P > This simple example will draw a frame on a bitmap. Ah, here's another buglet in the flash player- it doesn't seem to care about the second shape's bitmap's transformation in a morph. According to spec, the bitmap should stretch along with the shape in this example.. <TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" CLASS="EXAMPLE" ><TR ><TD ><DIV CLASS="example" ><A NAME="AEN54320" ></A ><P ><B >Example 1. <B CLASS="function" >swfshape->addfill()</B > example</B ></P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><PRE CLASS="php" ><?php $p = new SWFMorph(); $b = new SWFBitmap("alphafill.jpg"); // use your own bitmap $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); // these two have no effect! $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(); ?></PRE ></TD ></TR ></TABLE ></DIV ></TD ></TR ></TABLE > </P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.swfmovie.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.swfshape.drawcurve.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >SWFMovie</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.ming.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >SWFShape->drawCurve</TD ></TR ></TABLE ></DIV ></BODY ></HTML >