Jump to content


Php Script Lil Help


5 replies to this topic

#1 jatt

    Young Padawan

  • Members
  • Pip
  • 16 posts

Posted 04 July 2006 - 07:04 PM

hi, i been using this script for long on my site and it's for showing what are u playing on ur winamp and it displays on little jpg Image and. this si the code.
<?php
function inkort($txt, $length) { if(strlen($txt) > $length) { $txt = substr($txt, 0, $length)."..."; } return $txt; }

$content = $_GET[song];
if($content) {
$liedje = stripslashes(inkort($content, 30));
header("Content-type: image/JPEG");
$plaatje = ImageCreateFromJPEG("sig1xc.jpg");
$white = Imagecolorallocate($plaatje, 255, 255, 255);
$zwart = ImageColorAllocate($plaatje, 0, 0, 0);
imagestring($plaatje, 3, 70, 6, $liedje, $zwart);
ImageJPEG($plaatje, "winamp.jpeg", 100);
ImageDestroy($plaatje);
}
?>
when it displays on it displays as Black Text and i want to Chage the Color To White so it Displays as a White Text here is EX:Posted Image Hoply i did't confuse any one sorry i have a poor English. hope some one Can Help me out thx.

#2 DanWilliamson

    P2L Jedi

  • Members
  • PipPipPip
  • 650 posts

Posted 05 July 2006 - 01:44 AM

I would seriously have to guess that it will be the line with color on, but i'm not sure about the code that you use to make it white, for me i'm used to Hexadecimal but I had a go.

$zwart = ImageColorAllocate($plaatje, f, f, f);


#3 Matthew.

    Official Spammer .Matt

  • Members
  • PipPipPipPip
  • 2,749 posts
  • Gender:Male
  • Location:England

Posted 05 July 2006 - 04:32 AM

To change the text colour to white you simply change the RGB.

$zwart = ImageColorAllocate($plaatje, 255, 255, 255);

You will want to change the backgorund to black so you can see the text so also use..

$white = Imagecolorallocate($plaatje, 0, 0, 0);


#4 jatt

    Young Padawan

  • Members
  • Pip
  • 16 posts

Posted 05 July 2006 - 05:12 AM

lolzz ok i know in html for white is all FFFFFF and whats in Numbers lolz 55555?

#5 Mr. Matt

    Moderator

  • P2L Staff
  • PipPipPipPip
  • 1,945 posts
  • Gender:Not Telling

Posted 05 July 2006 - 05:21 AM

just for the record FFFFFF isn't HTML for white, its hexidecimal, and hexi (short) is made up of numbers 0-9 and letters A-F. I would go into my adcanced knowladge of A-Level computing but I would bore you and I can't remember it lol.

Matt

#6 Erik Bernskiold

    Jedi In Training

  • Members
  • PipPip
  • 422 posts
  • Gender:Male
  • Location:Gothenburg, Sweden
  • Interests:I love to do booth Web Design and Photography. Nothing beats a nice day out in the nature with the camera gear, getting loads of nice photos. I have been playing the flute for 6 years now and I love it, and I am playing the pipe organ as well. I also like to teach other people the in and outs of software such as the CS3 suite from Adobe.

Posted 05 July 2006 - 05:28 AM

View Postjatt, on Jul 5 2006, 12:12 PM, said:

lolzz ok i know in html for white is all FFFFFF and whats in Numbers lolz 55555?
If you are reffering to .Matt's post about the RGB values, RGB isn't the same as Hexadecimal. Where RGB stands for Red Green Blue it tells you the value of the different colours in a colour, I mean, it shows the amount of Red Green and Blue in the specific colour, where the RGB for white (HEx: #ffffff) is R: 255 G: 255 B: 255 which is then short written 225 225 255.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users