SWFDisplayItem
PHP 手册

SWFDisplayItem::multColor

(PHP 4 >= 4.0.5)

SWFDisplayItem::multColorMultiplies the item's color transform

说明

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

此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担 。

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().

参数

These parameters are floats between 0.0 and 1.0:

red

Value of red component

green

Value of green component

blue

Value of blue component

a

Value of alpha component

返回值

没有返回值。

范例

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/101.01.0);
  
$i->addColor(0xff*$n/2000);
  
$m->nextFrame();
}

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


SWFDisplayItem
PHP 手册