{"id":112,"date":"2008-05-24T18:54:42","date_gmt":"2008-05-24T16:54:42","guid":{"rendered":"http:\/\/www.hermione.de\/blog\/?p=112"},"modified":"2008-06-06T14:40:59","modified_gmt":"2008-06-06T12:40:59","slug":"banner-xd","status":"publish","type":"post","link":"http:\/\/blog.hermione.de\/?p=112","title":{"rendered":"ein Banner [perl]"},"content":{"rendered":"<h4>Der Banner<\/h4>\n<p><img decoding=\"async\" src=\"http:\/\/fwuniques.ath.cx\/uniques\/uniques_banner.cgi\" style=\"margin: 20px; width: 390px\" \/><\/p>\n<h4>Wie wirds gemacht?<\/h4>\n<p><!--more--><\/p>\n<table class=\"rosa\">\n<tbody>\n<tr>\n<td>\n<pre><code>#!\/usr\/bin\/perl\r\nuse strict;\r\nuse GD;\r\nmy $s = &lt; &lt;'EOF';\r\n#     # #     # ###  #####  #     # #######  #####\r\n#     # ##    #  #  #     # #     # #       #     #\r\n#     # # #   #  #  #     # #     # #       #\r\n#     # #  #  #  #  #     # #     # #####    #####\r\n#     # #   # #  #  #   # # #     # #             #\r\n#     # #    ##  #  #    #  #     # #       #     #\r\n #####  #     # ###  #### #  #####  #######  #####\r\nEOF\r\n\r\nmy @x = split(\/n\/, $s);\r\n\r\n<strong># neues bild erzeugen (breite, hoehe, truecolor = 1)<\/strong>\r\nmy $width = 600;\r\nmy $height = 80;\r\nmy $bild = new GD::Image($width,$height,1);\r\n\r\n<strong># farben<\/strong>\r\nmy $c000 = $bild-&gt;colorAllocate(0,0,0);\r\nmy $cbgg = $bild-&gt;colorAllocate(255,255,255);\r\n\r\n<strong># hintergrund<\/strong>\r\n$bild-&gt;filledRectangle(0,0,$width,$height,$cbgg);\r\n\r\nmy @imgs = glob(\"img\/*gif\");\r\nmy $xPos = 5;\r\nmy $yPos = 5;\r\n\r\nforeach(@x)\r\n{\r\n   foreach(split(\/\/, $_))\r\n   {\r\n      if($_ eq \" \")\r\n      {\r\n      } else\r\n      {\r\n         my $gif = $imgs[int(rand(@imgs))];\r\n         my $bildle = GD::Image-&gt;newFromGif($gif,1);\r\n         $bild-&gt;filledRectangle($xPos,$yPos,$xPos+9, $yPos+9, $c000);\r\n         $bild-&gt;copyResized($bildle,$xPos,$yPos,0,0,8,8,40,40);\r\n      }\r\n      $xPos += 10;\r\n   }\r\n   $xPos = 5;\r\n   $yPos += 10;\r\n}\r\n\r\n<strong># Ausgabe<\/strong>\r\nprint \"Content-type: image\/png\\n\\n\";\r\nprint $bild-&gt;png;<\/code><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Links<\/h4>\n<ul>\n<li><a href=\"http:\/\/www.figlet.org\/\">FIGlet<\/a><\/li>\n<li><a href=\"http:\/\/www.network-science.de\/ascii\/\">ASCII Generator<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Der Banner Wie wirds gemacht?<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,4],"tags":[],"_links":{"self":[{"href":"http:\/\/blog.hermione.de\/index.php?rest_route=\/wp\/v2\/posts\/112"}],"collection":[{"href":"http:\/\/blog.hermione.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.hermione.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.hermione.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.hermione.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=112"}],"version-history":[{"count":0,"href":"http:\/\/blog.hermione.de\/index.php?rest_route=\/wp\/v2\/posts\/112\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.hermione.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.hermione.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=112"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.hermione.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}