Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- header ("Content-type: image/png");
- $fileName = $_GET['i'];
- /*
- if(file_exists(dirname(__FILE__).'/ImageCache/'.$fileName.'.png')){
- echo(file_get_contents(dirname(__FILE__).'/ImageCache/'.$fileName.'.png'));
- exit;
- }
- */
- $img_handle = imagecreatetruecolor(25, 170);
- $back_color = ImageColorAllocateAlpha($img_handle, 0, 0, 0, 127);
- $txt_color = ImageColorAllocate($img_handle, 0, 0, 0);
- ImageFill($img_handle, 0, 0, $back_color);
- ImageStringUp ($img_handle, 2, 8, 165, $fileName, $txt_color);
- ImageRotate($img_handle, 180, $back_color);
- // Output & Save File
- ImageSaveAlpha($img_handle, true);
- ImagePng($img_handle, dirname(__FILE__).'/ImageCache/'.$fileName.'.png');
- ImageDestroy($img_handle);
- echo(file_get_contents(dirname(__FILE__).'/ImageCache/'.$fileName.'.png'));
- ?>
Add Comment
Please, Sign In to add comment