GD Issues.

This is a discussion on "GD Issues." within the PHP Forum section. This forum, and the thread "GD Issues. are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Mar 28th, 2007, 18:14
Reputable Member
Join Date: Sep 2006
Location: England
Age: 20
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
GD Issues.

PHP: Select all

<?php
    $username 
$gamertag;
    
$gamerpic "<img src=\"$gamertile\" width=\"38\" height=\"38\">;
    $im = imagecreatefrompng("
styles/homecourt.png");
    // $font = imageloadfont("
fonts/verdana.tff");
    imagestring($im, arial, 18, 20, $gamertag, ImageColorAllocate($im, 255, 255, 255));
    imagestring($im, arial, 120, 38, $gamerscore, ImageColorAllocate($im, 255, 255, 255));
    imagestring($im, arial, 120, 50, $gamerzone, ImageColorAllocate($im, 255, 255, 255));
    imagestring($im, arial, 18, 32, $gamerpic, ImageColorAllocate($im, 255, 255, 255));
    imagepng($im,"
cards/$username.png");
    
    echo("
<img src="cards/$username.png\">");
    
?>
Error #1
This isn't really an error, but i have no idea how i increase the font size? You'll see the image below, kinda small

Error #2
I need the $gamertile(comes from my other script) to be 38px by 38px, but i get a T_STRING error, it's on this line.

PHP: Select all

$gamerpic "<img src=\"$gamertile\" width=\"38\" height=\"38\">; 

I'm not sure if that's how you do it, but i thought i'd try, can anyone clear this up? How do i place an image ontop of it?

Error #3
Then, this biggest issue is the image some of it's transparency? You can't see it too well because of this forums background color, but it adds white around the image and a little more red?

Original PNG


Saved PNG


Thanks for any help!
Reply With Quote

  #2 (permalink)  
Old Mar 29th, 2007, 00:13
spinal007's Avatar
Moderator
Join Date: Mar 2004
Location: Good Ol'London
Age: 22
Posts: 1,620
Blog Entries: 1
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via ICQ to spinal007 Send a message via MSN to spinal007 Send a message via Yahoo to spinal007 Send a message via Skype™ to spinal007
Re: GD Issues.

I'm sorry mate, whish I could help, but I can't.
And by the looks of it, nobody else who has read this tread knows how to help.

Let me know how you get on...
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
Reply With Quote
  #3 (permalink)  
Old Mar 29th, 2007, 00:30
Reputable Member
Join Date: Sep 2006
Location: England
Age: 20
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Re: GD Issues.

Well the echoing of html in the image won't work but i got an alternative and i managed to get some help on the text, I can add a little shadow underneath and change the font size

Just the quality issue now =/

Reply With Quote
  #4 (permalink)  
Old Mar 29th, 2007, 08:26
Reputable Member
Join Date: May 2006
Location: Northampton, UK
Posts: 399
Thanks: 0
Thanked 0 Times in 0 Posts
Re: GD Issues.

i play with the gd library a bit..... but im not overly familiar with it..... can you explain a bit more about what your trying to do here?
Reply With Quote
  #5 (permalink)  
Old Mar 29th, 2007, 13:44
Reputable Member
Join Date: Sep 2006
Location: England
Age: 20
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Re: GD Issues.

I'm new to GD aswell, but this is for a gamercard website i'm making, a gamercard is your stats from your xboxlive gold account, displays gamerscore, name zone, gamerpic and such.
Reply With Quote
  #6 (permalink)  
Old Mar 29th, 2007, 13:47
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: GD Issues.

Yeah ... I don't know GD either. I've played around a bit with ImageMagick but only to create thumbnails - http://www.imagemagick.org/Usage/
Reply With Quote
  #7 (permalink)  
Old Apr 5th, 2007, 16:53
Junior Member
Join Date: Jan 2006
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Re: GD Issues.

Rather than specifying 'arial' as the second parameter, use '5' for a larger built-in font (you can use 1 - 5 with size increasing as you go up the scale).
More on the php page for imagestring.

If you want exact sizes either use a tailored font and load with imageloadfont or something a little more tedious create each letter as a graphic, split your input string letter by letter, then print each corresponding letter image side by side...
Reply With Quote
Reply

Tags
fonts, png

Thread Tools

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help! FF & IE7 issues gwalker Web Page Design 5 Jun 6th, 2008 02:08
IE and FF Issues... Aaron1988 Web Page Design 0 May 10th, 2008 15:52
Serious issues in IE7 Daimz Web Page Design 2 Aug 21st, 2007 12:38
CSS Issues. Can you help me out? escaflowne11 Web Page Design 7 Sep 13th, 2006 13:18
More issues. mreine Webforumz Suggestions and Feedback 7 Mar 13th, 2006 01:49


All times are GMT. The time now is 11:15.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43