13
Feb

50 Shades of Grey

categories Aktuelles, Computer, PHP    

Naja, jeder redet doch darüber, oder? 🙂

<br />
header(&quot;Content-type: image/png&quot;);<br />
$head = &quot;50 Shades of Grey&quot;;<br />
$im = imagecreate(500,280);<br />
$background_color = imagecolorallocate($im, 0, 0, 0);</p>
<p>$orange = imagecolorallocate($im, 220, 210, 60);<br />
$px = (imagesx($im) - 7.5 * strlen($head)) / 2;<br />
imagestring($im, 3, $px, 9, $head, $orange);</p>
<p>$colc = 5;</p>
<p>for ($i = 0; $i &lt; 500; $i = $i + 50) {<br />
    for ($j = 29; $j &lt; 250; $j = $j + 50) {<br />
        $col = imagecolorallocate($im, $colc, $colc, $colc);<br />
        imagefilledrectangle($im, $i+1, $j+1, $i+49, $j+49, $col);</p>
<p>        $coln = str_pad(dechex($colc), 2, &quot;0&quot;, STR_PAD_LEFT);<br />
        imagestring($im, 2, $i+2, $j+2, &quot;#&quot;.$coln.$coln.$coln, $orange);<br />
        $colc += 5;<br />
    }<br />
} </p>
<p>imagepng($im);<br />
imagedestroy($im);<br />

Kommentare

Leave a comment!