View previous topic :: View next topic |
Author |
Message |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Mon Dec 01, 2003 2:59 am Post subject: GD Library (Help!) |
|
|
I tried everything to install the GD Library for creating images
using the php_gd.dll file but nothing seemed to work , I looked
all over the internet for answers but all I found was 404 errors.
How exactly do I get PHP to generate images !
-------------------------------------------------------------------------------------------------
List of Trouble's:
I removed the ; from the extensions for php_gd.dll
(Same file in my original PHP folder)
I added an extra line to the path to that file
extensions directory: "C:\Program Files\PHP"
I tried the following example PHP script to generate a
image created by the PHP Interpreter.
button.php
Code: | <?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);
?>
<img src="button.php?text=text">
|
--------------------------------------------------------------------------------------------------
Please someone in this forum let me on your Messenger
so I can get this thing to work , what am I doing wrong ? |
|
Back to top |
|
 |
Anonymoose -
Joined: 09 Sep 2003 Posts: 2192
|
Posted: Mon Dec 01, 2003 3:44 am Post subject: |
|
|
You do know that doesn't generate the initial image, it takes an existing one and overlays the text you specify in your button tag right ? |
|
Back to top |
|
 |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Mon Dec 01, 2003 6:44 pm Post subject: |
|
|
Your right ! I got it to work , what this php script thing dose is take a already made image and puts text on top of it so you can create
labled images , its really cool. Is their any PHP script out their that can create images lol :D
P.S. If I wanted to embed a font file in that PHP script
smast.ttf and that font is located in my web root , how
would I go about doing that ? |
|
Back to top |
|
 |
Anonymoose -
Joined: 09 Sep 2003 Posts: 2192
|
Posted: Mon Dec 01, 2003 10:09 pm Post subject: |
|
|
You can have it create basic blank images but I haven't seen any tutorials for anything more fancy. The Macromedia tutorial goes into more details.This site has some very nice buttons and explanation of how to create them...
http://nyphp.org/content/presentations/GDintro/gd26.php |
|
Back to top |
|
 |
NeoJ -
Joined: 02 Nov 2003 Posts: 4
|
Posted: Wed Dec 17, 2003 7:03 pm Post subject: |
|
|
Copy your php_gd.dll in your PHP directory. Example - C:/Program Files/PHP
it's all... :wink: |
|
Back to top |
|
 |
|