note 102740 added to image.examples-png
| From: | JohnD at osu1 dot php dot net | Date: | Wed, 02 Mar 2011 23:17:22 +0000 |
| Subject: | note 102740 added to image.examples-png | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-177516@lists.php.net to get a copy of this message | ||
The current example fails unless the "button1.png" file is located.
I modified the example to account for this:
<?php
if (file_exists("images/button1.png")){
header("Content-type: image/png");
$string = $_GET['text'];
$im = imagecreatefrompng("images/button1.png");
$orange = imagecolorallocate($im, 220, 210, 60);
$px = (imagesx($im) - 7.5 * strlen($string)) / 2;
imagestring ($im, 3, $px, 9, $string, $orange);
imagepng($im);
imagedestroy($im);
} else {
print ("File not fount, exiting...");
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 71.93.160.22
----
Manual Page -- http://www.php.net/manual/en/image.examples-png.php
Edit -- https://master.php.net/note/edit/102740
Del: integrated -- https://master.php.net/note/delete/102740/integrated
Del: useless -- https://master.php.net/note/delete/102740/useless
Del: bad code -- https://master.php.net/note/delete/102740/bad+code
Del: spam -- https://master.php.net/note/delete/102740/spam
Del: non-english -- https://master.php.net/note/delete/102740/non-english
Del: in docs -- https://master.php.net/note/delete/102740/in+docs
Del: other reasons-- https://master.php.net/note/delete/102740
Reject -- https://master.php.net/note/reject/102740
Search -- https://master.php.net/manage/user-notes.php