alin19 Posted February 2, 2008 Share Posted February 2, 2008 i'm thinking to try and make a visual moving image like thys: to declare 2 images the same, and when $i=1.3..5...7..9.. to generate image1, when $i=2...4...6..8...10 to generate image 2 and give the aspect that the image is generating dinamic, could something like this work? <?php $img= imagecreate(300,300); $img2= imagecreate(300,300); $background = imagecolorallocate($img,200,200,200); $black = imagecolorallocate($img,0,0,0); $background2 = imagecolorallocate($img2,200,200,200); $black2 = imagecolorallocate($img2,0,0,0); header("Content-type: image/png"); for ($i=1;$i<300;$i+=0.01) { imagesetpixel($img,$i,$i,$black); imagesetpixel($img2,$i,$i,$black2); sleep(1); if ($i / 2 != int) { imagedestroy ($img2); imagepng($img); } if ($i / 2 == int ) { imagedestroy ($img); imagepng($img2); } } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.