Guest User

Untitled

a guest
Jan 18th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. for($x=1;$x<=255;$x++) {
  2. echo chr($x) . "&nbsp;";
  3. }
  4.  
  5. <?php
  6. // Set the content-type
  7. header('Content-Type: image/png');
  8.  
  9. // Create the image
  10. $im = imagecreatetruecolor(400, 30);
  11.  
  12. // Create some colors
  13. $white = imagecolorallocate($im, 255, 255, 255);
  14. $grey = imagecolorallocate($im, 128, 128, 128);
  15. $black = imagecolorallocate($im, 0, 0, 0);
  16. imagefilledrectangle($im, 0, 0, 399, 29, $white);
  17.  
  18. // The string with character sets
  19. for($i=0; $i<256; $i++){
  20. $text.= chr($i);
  21. }
  22.  
  23. // Replace path by your own font path
  24. $font = 'arial.ttf';
  25.  
  26. // Add some shadow to the text
  27. imagettftext($im, 20, 0, 11, 21, $grey, $font, $text);
  28.  
  29. // Add the text
  30. imagettftext($im, 20, 0, 10, 20, $black, $font, $text);
  31.  
  32. // Using imagepng() results in clearer text compared with imagejpeg()
  33. imagepng($im);
  34. imagedestroy($im);
  35. ?>
Add Comment
Please, Sign In to add comment