Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
|
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 22nd, 2009, 04:59 AM
Registered User
 
Join Date: Dec 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default drawing lines with a delay

how do you draw lines with a delay of, say 5 seconds, between each line - below is my code - the problem is that the statement ImagePng($handle) draws the image after the plot and doesn't seem to accept being called more than once:

$x1=0;
$y1=0;
$first_one="yes";
while($nt=mysql_fetch_array($qt)){

$x2=$x1+$x_gap; // Shifting in X axis
$y2=$y_max-$nt[sales]; // Coordinate of Y axis

if($first_one=="no"){ // this is to prevent from starting $x1= and $y1=0
imageline ($handle,$x1, $y1,$x2,$y2,$txt_color); // Drawing the line between two points

ImagePng ($handle);
sleep(2);
}
$x1=$x2; // Storing the value for next draw
$y1=$y2;
$first_one="no"; // Now flag is set to allow the drawing
}

ImagePng ($handle);


thanks

Abbey





Similar Threads
Thread Thread Starter Forum Replies Last Post
Loop a select but with a delay between each try chubnut SQL Server 2005 1 June 11th, 2008 06:26 AM
Combobox Populating Delay aw23 Access VBA 24 June 8th, 2005 03:39 AM
delay in adding tables kondapally Crystal Reports 0 January 12th, 2005 02:27 PM
time delay pab006 Classic ASP Basics 2 January 29th, 2004 05:16 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.