Guest User

Untitled

a guest
Nov 23rd, 2010
396
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.67 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Demotivators rendering script
  4.  * Copyright (c) by Fenek
  5.  * For Eris-Chan (http://www.erischan.pl/)
  6.  */              
  7.  
  8. header("Content-type: image/png"); // Informacja dla przeglądarki, że jest to obraz
  9.  
  10. $Title = $_GET['title']; // Sprawdzenie poprawności tytułu
  11. $Description = $_GET['description']; // Sprawdzenie poprawności opisu
  12.  
  13. $Image = imagecreatetruecolor(750, 600); // Stworzenie obrazka 750*600 px
  14. $AlterImage = imagecreatefromjpeg($_GET['img']);
  15.  
  16. $Background = imagecolorallocate($Image, 0, 0, 0); // Kolor tła; czarny
  17. $White = imagecolorallocate($Image, 255, 255, 255); // Kolor tekstu; biały
  18. $Footer[0] = imagecolorallocate($Image, 128, 128, 128); // Kolor tekstu; szary
  19. $Footer[1] = imageloadfont('erischan.pl.gdf'); // Wczytanie czcionki dla stopki
  20. $Fonts = array('Times_New_Roman.ttf', 'Arial.ttf', 'Verdana.ttf', 'Tahoma.ttf');
  21.  
  22. imagefill($Image, 0, 0, $Background); // Wypełnij kolorem czarnym zaczynając od punktu 0,0
  23. imagefilledrectangle($Image, 70, 45, 680, 455, $White); // Stwórz prostokąt zaczynając od punktu 70,45, a kończąc w punkcie 680,455 i wypełnij go kolorem białym
  24. imagefilledrectangle($Image, 72, 47, 678, 453, $Background);
  25.  
  26. imagestring($Image, $Footer[1], 660, 585, 'erischan.pl', $Footer[0]); // Wypisz stopkę
  27. imagestring($Image, $Footer[1], 10, 585, 'Copyright (c) by Fenek', $Footer[0]);
  28. imagettftext($Image, 46, 0, 200, 510, $White, $Fonts[0], $Title); // Wypisz tytuł używając określonej czcionki
  29. imagettftext($Image, 16, 0, 100, 555, $White, $Fonts[1], $Description);
  30.  
  31. imagecopy($Image, $AlterImage, 72, 47, 0, 0, 606, 406);
  32.  
  33. imagepng($Image);
  34. imagedestroy($Image);
  35. imagedestroy($AlterImage);
  36. ?>
Advertisement
Add Comment
Please, Sign In to add comment