Search Members Help

» Welcome Guest
[ Log In :: Register ]

 

[ Track This Topic :: Email This Topic :: Print this topic ]

reply to topic new topic new poll
Topic: PHP4 Graphics< Next Oldest | Next Newest >
 Post Number: 1
psychopharmacologist Search for posts by this member.
Optasne meum ferrum gustare?!
Avatar



Group: Members
Posts: 66
Joined: Jul. 2000
PostIcon Posted on: Jul. 19 2001,19:51  Skip to the next post in this topic. Ignore posts   QUOTE

Does PHP4 generate Graphics on the fly?

I got the following code from a tutorial at freeskills.com

$image = ImageCreate(200,150);
$gray =ImageColorAllocate($image,204,204,204);
ImageLine($image, 10,10, 150,30, $blue);

However when i try to run the script, php sez that none of the functions exist. And I'm pretty sure that php is installed and working fine, I've gotten it to do basic text stuff.
btw, i'm running this on a win98 machine, w/apache. so i'm using localhost to test everything.
So does anyone know if those functions actualy exist, or am I doing something wrong?

Offline
Top of Page Profile Contact Info 
 Post Number: 2
incubus Search for posts by this member.
mack daddy
Avatar



Group: Admins
Posts: 1316
Joined: May 2000
PostIcon Posted on: Jul. 19 2001,20:15 Skip to the previous post in this topic. Skip to the next post in this topic. Ignore posts   QUOTE

are you sure you dont need modules or something?

a bit like mrtg uses the gd module to make graphs and stuff?

Offline
Top of Page Profile Contact Info WEB 
 Post Number: 3
cr0bar Search for posts by this member.
FNG
Avatar



Group: Members
Posts: 733
Joined: May 2000
PostIcon Posted on: Jul. 19 2001,21:28 Skip to the previous post in this topic. Skip to the next post in this topic. Ignore posts   QUOTE

It's exactly that. You need to get gd and compile PHP --with-gd
Offline
Top of Page Profile Contact Info WEB 
 Post Number: 4
RenegadeSnark Search for posts by this member.
Old School
Avatar



Group: Members
Posts: 534
Joined: May 2000
PostIcon Posted on: Jul. 19 2001,21:30 Skip to the previous post in this topic. Skip to the next post in this topic. Ignore posts   QUOTE

Or you could shell to the program "convert" from ImageMagick and do it like a real l33t hax0r does it.


Offline
Top of Page Profile Contact Info 
 Post Number: 5
psychopharmacologist Search for posts by this member.
Optasne meum ferrum gustare?!
Avatar



Group: Members
Posts: 66
Joined: Jul. 2000
PostIcon Posted on: Jul. 20 2001,01:30 Skip to the previous post in this topic. Skip to the next post in this topic. Ignore posts   QUOTE

ahh, that makes sense... thanx.

Not to seem helpless or anything, but where might i get this magical module?

Offline
Top of Page Profile Contact Info 
 Post Number: 6
porn_dealer Search for posts by this member.
DetVet
Avatar



Group: Members
Posts: 207
Joined: May 2000
PostIcon Posted on: Jul. 20 2001,01:51 Skip to the previous post in this topic. Skip to the next post in this topic. Ignore posts   QUOTE

When using ImageMagick w/ PHP, a sample app to draw text over an image might look like this:

<?php
// text str to write
$str = "Hello";

// x/y coords of where to draw the text
$x = 312;
$y = 0;

// -draw switch to pass to convert
$draw = "-draw \"text $x,$y '$str'\"";

// original image to write text over:
$original_image = "/usr/sites/mysite/htdocs/images/blank_dong.jpg"; // dont ask.

// font
$font_to_use = "$DOCUMENT_ROOT/verdana.ttf";

// write the header
header("Content-type: image/jpeg");

// align (Center, West, East, South, etc.)
$align = "Center";

// text color
$font_color = "#FFFFFF";

// run /usr/local/bin/convert
passthru("/usr/local/bin/convert -font @$font_to_use -pointsize 14 -gravity $align -quality 100 -antialias -pen \$font_color $draw $original_image jpeg:-");

// done!

?>

------------------
I swear to god the combined IQ of these forums (not including the ladies) must be less than the cost of a used 85 honda civic with severe rear damage...
-- Kamilion

Offline
Top of Page Profile Contact Info WEB 
 Post Number: 7
porn_dealer Search for posts by this member.
DetVet
Avatar



Group: Members
Posts: 207
Joined: May 2000
PostIcon Posted on: Jul. 20 2001,01:53 Skip to the previous post in this topic.  Ignore posts   QUOTE

If you want VD--err GD, goto www.boutell.org/gd/ (i believe)
Offline
Top of Page Profile Contact Info WEB 
6 replies since Jul. 19 2001,19:51 < Next Oldest | Next Newest >

[ Track This Topic :: Email This Topic :: Print this topic ]


 
reply to topic new topic new poll

» Quick Reply PHP4 Graphics
iB Code Buttons
You are posting as:

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code