whatimplayin.php
whatimplayin.php
I was just wondering if anyone knows how to make the image resize with the length of text outputed?
I just have the basic setup http://www.hipbase.com/radio/whatimplayin.php
I knoticed hows jays sig image always resizes.
Thanks
I just have the basic setup http://www.hipbase.com/radio/whatimplayin.php
I knoticed hows jays sig image always resizes.
Thanks
- Jay
- Will work for food (Administrator)
- Posts: 3020
- Joined: Mon Jan 14, 2002 12:48 am
- Location: Next Door
- Contact:
yea I have somewhat modified it from the original script and cannot release the updated script due to the fact that I now use True Type Fonts, and some installations of PHP will not support it. The TTF functions are what I used to determine how wide the image should be.
If you have the true type library installed check out the following two functions
imagettfbbox -- Give the bounding box of a text using TrueType fonts
imagettftext -- Write text to the image using TrueType fonts
If you have the true type library installed check out the following two functions
imagettfbbox -- Give the bounding box of a text using TrueType fonts
imagettftext -- Write text to the image using TrueType fonts
- Jay
How do I change the font color?
http://www.hipbase.com/radio/whatimplayin.php
Code: Select all
<?php
include("includes.php");
header("Content-Type: image/png");
$im = imagecreatefrompng("songband1.png");
if ($im)
{
ImageString($im, 1, 37, 4, "Hipbase.com Radio - Live Tragically Hip".$desc, 5);
ImageString($im, 2, 67, 12, "Currently Playing: ".$current_song, 1);
ImageString($im, 2, 67, 23, "There are $listeners / $max_listeners listeners", 2);
ImagePNG($im);
}
?>
How do I change the font color?
http://www.hipbase.com/radio/whatimplayin.php
Code: Select all
<?php
include("includes.php");
header("Content-Type: image/png");
$im = imagecreatefrompng("songband1.png");
if ($im)
{
ImageString($im, 1, 37, 4, "Hipbase.com Radio - Live Tragically Hip".$desc, 5);
ImageString($im, 2, 67, 12, "Currently Playing: ".$current_song, 1);
ImageString($im, 2, 67, 23, "There are $listeners / $max_listeners listeners", 2);
ImagePNG($im);
}
?>
how to resize the image?? o_O
Hi Jay, i'm not into php
so would you mind to post the updated script please
And is it possible to show Currently Offline if you are offline?
Thanks in advance
so would you mind to post the updated script please
And is it possible to show Currently Offline if you are offline?
Thanks in advance
- Jay
- Will work for food (Administrator)
- Posts: 3020
- Joined: Mon Jan 14, 2002 12:48 am
- Location: Next Door
- Contact:
colors are referenced from the original image, the last number parameter given in the image string function points to the color in the png color palette. If you want to add colors to the pallete, be sure to do this before calling ImageString, and use the number returned by the function, imagecolorallocate. For a complete list of functions related to php image creation: read http://www.php.net/manual/en/ref.image.php
- Jay