1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
<?php
header ("Content-type: image/png");
$im = ImageCreate (256, 256)
or die ("Erreur lors de la création de l'image");
$r = 255;
$g = 0;
$b = 0;
$x = 0;
while ($g <= 255) {
$y = 0;
$col = ImageColorAllocate ($im, $r, $g, $b);
while ($y <= 255) {
ImageSetPixel($im, $x, $y, $col);
$y = $y + 1;
}
$x = $x + 0.1;
$g++;
}
while ($r >= 0) {
$y = 0;
$col = ImageColorAllocate ($im, $r, $g, $b);
while ($y <= 255) {
ImageSetPixel($im, $x, $y, $col);
$y = $y + 1;
}
$x = $x + 0.1;
$r--;
}
ImagePng($im);
?> |
Partager