Source: lesson_17_dessin_a.php | Résultat |
<img src="../exercises/dessin_a.php">
Fichier : dessin_a.php
<?php header("Content-type: image/Jpeg"); // Create a new Image $im = ImageCreate(285,285); // Fill it with your favorite background color.. $backgroundColor = ImageColorAllocate($im,247,243,198); $lineColor = ImageColorAllocate($im, 0,0,0); //ImageFill($im, 0, 0, $backgroundColor); $a=0; $b=200; for($i=0;$i<500;$i=$i+12) { imageline($im,45,275-$a,$a+3,175-$a+7,$lineColor); $a=$a+4; }
Imageinterlace($im, 1); // Output the Image to the browser in jpeg format ImageJpeg($im); // Destroy the image. ?>
|
|