GD
Moderator: General Moderators
- dull1554
- Forum Regular
- Posts: 680
- Joined: Sat Nov 22, 2003 11:26 am
- Location: 42:21:35.359N, 76:02:20.688W
http://www.php.net/GD
*i think*
*i think*
-
Straterra
- Forum Regular
- Posts: 527
- Joined: Mon Nov 24, 2003 8:46 am
- Location: Indianapolis, Indiana
- Contact:
Yeah, I am looking at that (http://us3.php.net/image) but, it doesn't give any examples that I am finding useful... Like, for example, how to open an image for editing.
- dull1554
- Forum Regular
- Posts: 680
- Joined: Sat Nov 22, 2003 11:26 am
- Location: 42:21:35.359N, 76:02:20.688W
Code: Select all
<?php
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);
?>Dull, forgive me for using your code..
With commentary to clarify:
With commentary to clarify:
Hope that helps.dull1554 wrote:Code: Select all
<?php header("Content-type: image/png"); //Tell the browser that an image is coming $string = $_GET['text']; // Set variable to text to put on top of image $im = imagecreatefrompng("images/button1.png"); // Make an image ($im) FROM (based on) button1.png $orange = imagecolorallocate($im, 220, 210, 60); // $orange is the rgb values for orange. $px = (imagesx($im) - 7.5 * strlen($string)) / 2; // What size should the text be in pixels, based on the length of the string imagestring($im, 3, $px, 9, $string, $orange); // Put the text on the picture at size $px, in color $orange. imagepng($im); // Output the now-modified picture. imagedestroy($im); // Delete the picture from memory. ?>
- dull1554
- Forum Regular
- Posts: 680
- Joined: Sat Nov 22, 2003 11:26 am
- Location: 42:21:35.359N, 76:02:20.688W
@ Roja
it's no problem, i have a question for you seeing that you know what your doing, i use some GD commands but i can only test these so called "GD" scripts on my web server, and not on my local server, i was not the one who set up GD on my server so i don't know how to nor have found install directions that i can understand, is there a place that tells me what i need to download and how to install it so i can use GD on my local server
it's no problem, i have a question for you seeing that you know what your doing, i use some GD commands but i can only test these so called "GD" scripts on my web server, and not on my local server, i was not the one who set up GD on my server so i don't know how to nor have found install directions that i can understand, is there a place that tells me what i need to download and how to install it so i can use GD on my local server