GD Library (Help!)

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Mon Dec 01, 2003 2:59 am    Post subject: GD Library (Help!) Reply with quote

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 View user's profile Send private message Visit poster's website
Anonymoose
-


Joined: 09 Sep 2003
Posts: 2192

PostPosted: Mon Dec 01, 2003 3:44 am    Post subject: Reply with quote

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 View user's profile Send private message
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Mon Dec 01, 2003 6:44 pm    Post subject: Reply with quote

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 View user's profile Send private message Visit poster's website
Anonymoose
-


Joined: 09 Sep 2003
Posts: 2192

PostPosted: Mon Dec 01, 2003 10:09 pm    Post subject: Reply with quote

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 View user's profile Send private message
NeoJ
-


Joined: 02 Nov 2003
Posts: 4

PostPosted: Wed Dec 17, 2003 7:03 pm    Post subject: Reply with quote

Copy your php_gd.dll in your PHP directory. Example - C:/Program Files/PHP
it's all... :wink:
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group