Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- header("Content-type: image/png");
- putenv('GDFONTPATH=' . realpath('.'));
- // Randomize Values
- $randImage = rand(1,10);
- $randSize = rand(15,20);
- $randAngle = rand(-7,7);
- $randR = rand(0,255);
- $randG = rand(0,255);
- $randB = rand(0,255);
- $quote = file("quotes.txt");
- $quoteCount = count($quote);
- $randQuote = rand(0, $quoteCount - 1);
- // Assign Random Values to Variables
- $image = imagecreatefrompng("pngs/$randImage.png");
- $size = $randSize;
- $angle = $randAngle;
- $posX = 150;
- $posY = 80;
- $color = imagecolorallocate($image, $randR, $randG, $randB);
- $font = 'fonts/Glass_TTY_VT220';
- $string = html_entity_decode($quote[$randQuote]);
- // Load Image/Text using the Previously Assigned Variables...
- imagettftext ($image, $size, $angle, $posX, $posY, $color, $font, $string);
- imagepng($image);
- imagedestroy($image);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement