» Quick Links
You can make money on these forums
We Share profits with you
Google
Google Adsense
Google Adwords
YPN
Yahoo
MSN Search
Web Directories
Web Hosting
Web Hosting Offers
Hosting News
Suggestions
Link Building
Domain Names
PHP Forums
MySQL Forums
» More Links
OSP News
Reseller Hosting
Shared Hosting
Dedicated Servers
Google Adsense
Search Engine Marketing
Link Development
Affiliate Marketing


» Advertising
Multiple DC PR Check

Free SEO Tools


Go Back   Webmaster Forums > Website Developement / Programming > PHP Programming and Tips

PHP Programming and Tips Discuss about PHP programming and Share Tips. Ask questions about Scripting and Errors.

Reply
 
Thread Tools Display Modes
  #1  
Old 08-25-2006, 09:58 AM
panther panther is offline
OSP Starters
 
Join Date: Aug 2006
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
panther is on a distinguished road
Default Imagettftext - different font styles in one image

Good day everybody

I'm using imagettftext to generate a png image with text onto it, everything is fine except I need to have the first word in red and the second one in grey. If I just add another

Code:
imagettftext($im, 14, 0, 0, 29, $grey, $font, $text2);the second word will start at the end of the first png box (which is 400 pixels wide). Instead I'd like it to start right at the end of the first word ($text1), preferrably in the same png box. Here's what I use:

PHP Code:

ini_set('session.save_handler', 'files');
session_start();
// Set the content-type
header("Content-type: image/png");

// Create the image
$im = imagecreate(400, 34);

// Create some colors
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);
$red = imagecol -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Revenue Sharing Ads ( ?):
  #2  
Old 08-25-2006, 10:01 AM
desilva desilva is offline
OSP Starters
 
Join Date: Aug 2006
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
desilva is on a distinguished road
Default

Perhaps use two different image (imagettftext) resources, and then use imagecopymerge to overlay one on the other? -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Gd2 text on an image rouble PHP Programming and Tips 1 08-25-2006 09:27 AM
Host Color Announces Flash Image Gallery outsourcingplans Web Hosting News 0 08-18-2006 05:37 AM
Host Color Announces Flash Image Gallery outsourcingplans Web Hosting News 0 08-17-2006 04:34 AM
form to image in PHP tufnell PHP Programming and Tips 1 08-15-2006 01:30 PM
Ask Jeeves Launches Proprietary Image Search Technology outsourcingplans Web Hosting Industry 0 01-26-2006 07:05 PM


All times are GMT. The time now is 04:06 AM.