Hey, ich habe eine Schleife
Die zu jeden Pixel im Bild eine zufällige Farbe zuweist. Aber die Schleife läuft anscheinend nicht vollständig durch, da nur ein kleiner Teil ganz oben eingefärbt wird. Weiß einer woran das liegen könnte?
PHP-Code:
$_y = 0;
while($_y <= $height) {
$_x = 0;
while($_x <= $width) {
$_a = rand(0, 250); //Rot-Anteil
$_b = rand(0, 250); //Grün-Anteil
$_c = rand(0, 250); //Blau-Anteil
$_col = ImageColorAllocate($img, $_a, $_b, $_c);
imagesetpixel ( $img , $_x , $_y , $_col );
$_x++;
}
$_y++;
}
Kommentar