Ciao a Tutti, ho un file così composto (button.php):


codice:
<?php

  define("TextFONT", "3");

  function ConvertColor($hexVal){
    $ColorVal = array(3);
    for($i = 0; $i < 3; $i++)
      $ColorVal[$i] = HexDec(substr($hexVal, $i * 2, 2));
    return $ColorVal;
  }

  $width = strlen($txt) * ImageFontWidth(TextFONT);
  $offset = 2;
  $imgFRAME = ImageCreate($width, ImageFontHeight(TextFONT)+$offset);

  list($red, $green, $blue) = ConvertColor($bg);
  $bgCOLOR = ImageColorAllocate($imgFRAME, $red, $green, $blue);

  list($red, $green, $blue) = ConvertColor($fg);
  $fgCOLOR = ImageColorAllocate($imgFRAME, $red, $green, $blue);

  ImageFill($imgFRAME, 1, 1, $bgCOLOR);


  ImageString($imgFRAME, TextFONT, 1, 1, $txt, $fgCOLOR);

  header("Content-type: image/gif");
  ImageGIF($imgFRAME);
  ImageDestroy($imgFRAME);
?>

Che Poi si richiama con:

codice:
[img]button.php?fg=333333&bg=FFCC00&txt=TESTO[/img]
e crea un'immagine con TESTO di colore 333333 e sfondo FFCC00.
Vorrei che qualcuno mi aiutasse a modificare il file inserendo:
- SFONDO: immagine.gif (un'immagine nella root)
- Magari cambiando anche il tipo di FONT.

...Grazie 1000 x l'aiuto.