Current location: Hot Scripts Forums » Programming Languages » PHP » php GD libary


php GD libary

Reply
  #1 (permalink)  
Old 06-09-04, 01:19 PM
mavoric mavoric is offline
Newbie Coder
 
Join Date: Feb 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
php GD library

anyone know how to place a white box at the bottom of this image?

PHP Code:

<?php

   header
("Content-type: image/jpeg");
   
$string $_GET['text'];
   
$im    imagecreatefromjpeg("http://www.mysite.com/image.jpg");
   
$black imagecolorallocate($im00000000);
   
$px    = (imagesx($im) - 7.5 strlen($string)) / 2;
   
imagestring($im3$px9$string$black);
   
imagejpeg($im);
   
imagedestroy($im);
?>
as i have this, but i would like to put a white box behind the text? any ideas

Last edited by mavoric; 06-09-04 at 01:36 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 06-10-04, 12:18 PM
php~pro php~pro is offline
Wannabe Coder
 
Join Date: Jun 2004
Location: In a nice house.
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
Create a css class for the text with box attribute and apply it to the text.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 06-10-04, 04:45 PM
mavoric mavoric is offline
Newbie Coder
 
Join Date: Feb 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
how? sorry im new to gd, but know a bit bout php
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 06-10-04, 05:05 PM
Bonzo's Avatar
Bonzo Bonzo is offline
Coding Addict
 
Join Date: Jan 2004
Posts: 340
Thanks: 0
Thanked 0 Times in 0 Posts
Can you expand on your requirements : )

As I see it you want to use "http://www.mysite.com/image.jpg" as the background. On the background you want a white box and some text in the box.

If you use ImageMagick rather than GD you could add a white box image to the original image and then add some text to that image. Would probably take two passes at acheving this but you could use a temp image.

I know a good example of ImageMagick and would use it in preferance to GD; you have also caught me at a bad time as just removed my website to start again and have deleted all the things I tried.

Anthony

http://www.cit.gu.edu.au/~anthony/gr...ating/#overlay

P.S. PM me if you need some help
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP and MySQL ? rob2132 Hot Scripts Forum Questions, Suggestions and Feedback 4 08-29-08 03:22 AM
PHP integrated with ASP Mikeirv PHP 7 05-25-04 06:00 AM
PHP Dudes - Hi All stuart New Members & Introductions 4 05-03-04 02:22 PM
100 Web Templates & 10 PHP Scripts for sale! HostersUK.co.uk General Advertisements 0 01-10-04 01:31 AM
How to convert php generated pages to SE friendly HTML or PHP(SE friendly) -CLASS 101 crippled PHP 1 11-16-03 07:37 AM


All times are GMT -5. The time now is 09:46 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.