downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  

<SWFDisplayItem->moveTo()SWFDisplayItem->remove()>
Last updated: Thu, 26 Jun 2008

SWFDisplayItem->multColor()

(PHP 4 >= 4.0.5)

SWFDisplayItem->multColor() — Multiplies the item's color transform

Description

SWFDisplayItem
void multColor ( int $red , int $green , int $blue [, int $a ] )
Warning

This function is EXPERIMENTAL. The behaviour of this function, its name, and surrounding documentation may change without notice in a future release of PHP. This function should be used at your own risk.

swfdisplayitem->multcolor() multiplies the item's color transform by the given values.

The object may be a swfshape(), a swfbutton(), a swftext() or a swfsprite() object. It must have been added using the swfmovie->add().

Parameters

These parameters are integers between 0 and 255 or hexadecimals between 0x00 and 0xFF:

red

Value of red component

green

Value of green component

blue

Value of blue component

a

Value of alpha component

Return Values

No value is returned.

Examples

This simple example will modify your picture's atmosphere to Halloween (use a landscape or bright picture).

Example #1 swfdisplayitem->multcolor() example

<?php

$b
= new SWFBitmap(file_get_contents("backyard.jpg"));
// note use your own picture :-)
$s = new SWFShape();
$s->setRightFill($s->addFill($b));
$s->drawLine($b->getWidth(), 0);
$s->drawLine(0, $b->getHeight());
$s->drawLine(-$b->getWidth(), 0);
$s->drawLine(0, -$b->getHeight());

$m = new SWFMovie();
$m->setDimension($b->getWidth(), $b->getHeight());

$i = $m->add($s);

for (
$n=0; $n<=20; ++$n) {
 
$i->multColor(1.0-$n/10, 1.0, 1.0);
 
$i->addColor(0xff*$n/20, 0, 0);
 
$m->nextFrame();
}

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



add a noteadd a note User Contributed Notes
Multiplies the item's color transform
There are no user contributed notes for this page.




<SWFDisplayItem->moveTo()SWFDisplayItem->remove()>
Last updated: Thu, 26 Jun 2008
show source | credits | sitemap | contact | advertising | mirror sites
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://phpbuilder.com/
Last updated: Tue Nov 1 20:20:59 2005 EST
Columns / Articles | Tips / Quickies | News | News Linking and RSS Feeds | Shared Code Library
Mail Archives | Support / Discussion Forums | Get Started! Links | Contribute! | Docs