note 39895 added to function.imageline
| From: | XxXoldsaltXxX at hotmail dot com | Date: | Sat, 14 Feb 2004 15:50:21 +0000 |
| Subject: | note 39895 added to function.imageline | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-65141@lists.php.net to get a copy of this message | ||
Script to draw a grid of lines, which make the entire side of the picture look like a quarter
circle.. very cool :)
<?php
$img_disp = imagecreate(1000,1000);
$backcolor = imagecolorallocate($img_disp,0,0,0);
imagefill($img_disp,0,0,$backcolor);
$textcolor = imagecolorallocate($img_disp,255,0,0);
$x1 = 0;
$y1 = 0;
$x2 = 0;
$y2 = 1000;
for(;;){
$y1 = $y1 + 20;
$x2 = $x2 + 20;
imageline($img_disp,$x1,$y1,$x2,$y2,$textcolor);
if ($y1 == 1000){
break;
}
}
header("Content-type: image/png");
imagepng($img_disp); // Draw the image
imagedestroy($img_disp); // Delete the image from the server's memory
?>
----
Manual Page -- http://www.php.net/manual/en/function.imageline.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+39895
Delete -- http://master.php.net/manage/user-notes.php?action=delete+39895&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+39895&report=yes
Search -- http://master.php.net/manage/user-notes.php