stuppid_bot

Untitled

May 3rd, 2013
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.26 KB | None | 0 0
  1. <?php
  2.  
  3. error_reporting(E_ALL);
  4. $size = 32;
  5. $half_size = $size / 2;
  6. $font_file = 'Arial Black Regular.ttf';
  7. $text = 'WWW';
  8. list(,,$width) = imagettfbbox($size, 0, $font_file, $text);
  9. $im = imagecreate($width += $size, $height = $size * 2);
  10. imagecolorallocate($im, 0, 255, 255);
  11. $font_color = imagecolorallocate($im, 255, 255, 0);
  12. imagettftext($im, $size, 0, + $half_size, $size + $half_size, $font_color, $font_file, $text);
  13.  
  14. $width1 = 200;
  15. $height1 = 80;
  16. $offset_x = ($width1 - $width) / 2;
  17. $offset_y = ($height1 - $height) / 2;
  18. $rand1 = rand(20, 50) / 1000;
  19. $rand2 = rand(0, 50);
  20.  
  21. // так эта ебланская библиотека нихуя не рисует
  22. $im1 = imagecreate($width1, $height1);
  23. imagecolorallocate($im1, 255, 255, 255);
  24.  
  25. // $im1 = imagecreatetruecolor($width1, $height1);
  26.  
  27. for ($y = 0; $y < $height; ++$y) {
  28.     for ($x = 0; $x < $width; ++$x) {
  29.         $colors = imagecolorsforindex( $im, imagecolorat($im, $x, $y) );
  30.         $color = imagecolorallocate( $im1, $colors['red'], $colors['green'], $colors['blue']);    
  31.         $z = $y + floor( $half_size * sin($rand1 * $x + $rand2) );
  32.         imagesetpixel($im1, $offset_x + $x, $offset_y + $z, $color);      
  33.     }
  34. }
  35.  
  36. header('Content-type: image/png');
  37. imagepng($im1);
  38.  
  39. ?>
Advertisement
Add Comment
Please, Sign In to add comment