Antwort
Ich habe es endlich geschafft, eine funktionierende PHP zu schreiben.
Ich danke Euch allen vielmals!
Für Interessierte:
<?php
$code = "";
$breite = "359";
$hoehe = "5299";
$bild = imagecreatetruecolor($breite, $hoehe);
for( $i = 0; $i < $breite*$hoehe; $i++ ){
if($code[$i] == 1) {
$schwarz = imagecolorallocate($bild, 0, 0, 0);
$x = $i % $breite;
$y = floor($i / $breite);
imagesetpixel( $bild, $x, $y, $schwarz);
}
if($code[$i] == 0){
$weiss = imagecolorallocate($bild, 255, 255, 255);
$wx = $i % $breite;
$wy = floor($i / $breite);
imagesetpixel( $bild, $wx, $wy, $weiss);
}
};
header('Content-Type: image/png');
imagepng($bild);
?>