Guest User

Untitled

a guest
Jul 22nd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. <?php
  2.  
  3. function imageStringDown( &$image, $font, $x, $y, &$s, &$col )
  4. {
  5. $fw = imagefontwidth( $font);
  6. $fh = imagefontheight( $font);
  7.  
  8. $fontspacing = 0;
  9.  
  10. $fx = $x;
  11. $fy = $y;
  12.  
  13. for( $n=0; $n<strlen( $s ); $n++ )
  14. {
  15. $myc = $s{$n};
  16. imagestring( $image, $font, $fx, $fy, $myc, $col );
  17. $fy += ($fontspacing + $fh );
  18. }
  19. }
  20.  
  21. $img_handle = imagecreatetruecolor(25, 170);
  22.  
  23. $back_color = ImageColorAllocateAlpha($img_handle, 0, 0, 0, 127);
  24.  
  25. $txt_color = ImageColorAllocate($img_handle, 0, 0, 0);
  26.  
  27. ImageFill($img_handle, 0, 0, $back_color);
  28.  
  29. ImageStringDown ($img_handle, 5, 8, 5, $_GET['text'], $txt_color);
  30.  
  31. //-- Output File --
  32. header ("Content-type: image/png");
  33. ImageSaveAlpha($img_handle, true);
  34. ImagePng($img_handle);
  35. ImageDestroy($img_handle);
  36. ?>
Add Comment
Please, Sign In to add comment