Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
PHP doozie (image generation, advanced help please)
Old 08-08-2004, 09:40 PM PHP doozie (image generation, advanced help please)
Polarism's Avatar
Novice Talker

Posts: 11
Trades: 0
I would like to have some sort of function that generates an image based off of entries I made into an admin type control page. Basically the image created would have to generate text overlayed transparently onto an existing image on a webpage and would have to include the font, etc as well as be hyperlinked to whatever destination I entered in the control page.

How would I go about doing this? I have some basic php knowledge but i'm nowhere near advanced to just spit out code into notepad from my own brain out of nothing yet.

Preferably I could generate it anywhere on the actual webpage I wanted to, and I would settle for not being able to overlay on an existing image, and instead just generating a box itself, with the photoshop-style sliced hyperlinked text on the image.

Also, I need to do it twice, on either side of a central logo a half inch away on either side.

Thanks!
Polarism is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-09-2004, 06:40 AM
webwoRRks's Avatar
Ultra Talker

Posts: 426
Location: I hope so
Trades: 0
You're looking for ImageMagick or GD. I suggest ImageMagick. Check you have it installed; here is an example peice of code, set $image to a blank image, or something you don't mind messing up completely....

PHP Code:
<?php
@exec("mogrify -fill #00CC00 -pointsize 20 -font Arial.ttf -draw \"text 30,30 'Hello'\" $image");
?>
This will draw the text 'Hello' onto $image in the Arial font at a height of 20 pt (or does it do it in px.... I forget) In a horrible neon green colour (#00CC00).

Practice, practice, practice, practice, practice makes reasonable.
__________________
Theres 10 types of people; those who understand binary, and those who don't.
webmaster and webdeveloper resources,
Please login or register to view this content. Registration is FREE

Last edited by webwoRRks; 08-09-2004 at 06:45 AM.. Reason: hit enter key by mistake
webwoRRks is offline
Reply With Quote
View Public Profile Visit webwoRRks's homepage!
 
Old 08-09-2004, 08:11 AM
Polarism's Avatar
Novice Talker

Posts: 11
Trades: 0
With the $image stuff, how's the variable work? Do I put the URL there in some form?

I just took your code and pasted it in, changing "$image" to "/images/myimage.gif" but nothing happened.



http://www.polarism.com/indextst2.php

Just trying to write on either side of the middle image.
Polarism is offline
Reply With Quote
View Public Profile
 
Old 08-09-2004, 08:24 AM
webwoRRks's Avatar
Ultra Talker

Posts: 426
Location: I hope so
Trades: 0
check you have image magick installed;

PHP Code:
<?php
@exec("mogrify -fill #FFFF00 -draw \"rectangle 10,10 60,160\" images/myimage.gif");
?>
Make sure myimage.gif is a real file, and greater that 10x10px (so you'll see the change). Run this. If it changes, you have ImageMagick.
__________________
Theres 10 types of people; those who understand binary, and those who don't.
webmaster and webdeveloper resources,
Please login or register to view this content. Registration is FREE
webwoRRks is offline
Reply With Quote
View Public Profile Visit webwoRRks's homepage!
 
Old 08-09-2004, 12:13 PM
Polarism's Avatar
Novice Talker

Posts: 11
Trades: 0
Apparently I must not then, how would I do it with GD functions? (as I know that's installed)
Polarism is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to PHP doozie (image generation, advanced help please)
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.52742 seconds with 12 queries