note 93023 added to function.swfdisplayitem.multcolor

From: Date: Wed, 19 Aug 2009 21:15:33 +0000
Subject: note 93023 added to function.swfdisplayitem.multcolor
Groups: php.notes 
Request: Send a blank email to php-notes+get-159661@lists.php.net to get a copy of this message
Hey, this is a great function that I spent a lot of time looking for. What is it great for? Fading. It gives you the ability to fade any supported object (including images) totally or even specific color channels. The project I am working on requires a series of images and backgrounds to fade into each other. As a bit of a noob, I found the doc here and it's example a little confusing. I thought that to provide a value for a color channel would change it, but it doesn't. To say, just change the alpha channel value, you can write it like this <?php $movie=new SWFMovie(); $movie->setDimension(700,150); $movie->setBackground(0,255,255); // image to add to movie $img="images/example.jpg"; // add it image to movie and fade its alpha channel $png = new SWFBitmap(fopen($img,"rb")); $f1 = $movie->add($png); $f1->multColor(1,1,1,0.5); ?> This code will load the image and give it s 50% transperancy. Similarly, one can fade a single color channel by reducing the value for that specific channel. <?php $ft->multColor(0.5,1,1); ?> This makes the red channel (remember rgb) 50% transparent. You can put a 0 there to completely remove the red channel. Hope this helps any fellow noobs trying to figure out ming out there. ---- Server IP: 66.207.199.35 Probable Submitter: 154.5.33.118 ---- Manual Page -- http://www.php.net/manual/en/function.swfdisplayitem.multcolor.php Edit -- https://master.php.net/note/edit/93023 Del: integrated -- https://master.php.net/note/delete/93023/integrated Del: useless -- https://master.php.net/note/delete/93023/useless Del: bad code -- https://master.php.net/note/delete/93023/bad+code Del: spam -- https://master.php.net/note/delete/93023/spam Del: non-english -- https://master.php.net/note/delete/93023/non-english Del: in docs -- https://master.php.net/note/delete/93023/in+docs Del: other reasons-- https://master.php.net/note/delete/93023 Reject -- https://master.php.net/note/reject/93023 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#159661) next »