Jump to content

dinamic image


alin19

Recommended Posts

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);

}

}

 

 

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.