[PHP] Tekst kleur werkt niet mee

Pagina: 1
Acties:

  • zeroxcool
  • Registratie: Januari 2001
  • Laatst online: 04-09 13:39
Hallo, heb gisteren een scriptje half her-geprogrammeerd. Maar nou wil de tekst kleur van de imagestring(); niet wit worden. Hier mijn script:
code:
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
// Maak een JPEG header  
Header("Content-type: image/jpeg");  

// Kopieer het plaatje van een reeds bestaand bestandje  
$plaatje = ImageCreateFromJPEG("files/review/" . $titel_klein . "/" . $id . ".jpg");  

// Zoek hoe breed en hoe hoog de tekst gaat worden  
$font = "styles/verdana.ttf";  
$box = ImageTTFBBox(13, 0, $font, "http://www.gameone.nl");  
$hoogte = $box[1] - $box[7];
$breedte = $box[2] - $box[0];    

// Bereken de "default" coordinaten  
$x_coordinaat = $box[0];  
$y_coordinaat = $hoogte - $box[1];    

// Bereken nu de verschuiving die nodig is om de tekst de centreren  
$offset_x = (int)((ImageSX($plaatje) - $breedte)) - 5;  
$offset_y = (int)((ImageSY($plaatje) - $hoogte)) - 6; 

// Teken de tekst  
$white = imagecolorallocate($plaatje, 255, 255, 255);  
$black = imagecolorallocate($plaatje, 000, 000, 000);   
ImageString($plaatje, 13, $x_coordinaat + $offset_x - 15, $y_coordinaat + $offset_y - 12, "http://www.gameone.nl", $white); 
//ImageTTFText($plaatje, 13, 0, $x_coordinaat + $offset_x, $y_coordinaat + $offset_y, $white, $font, "http://www.gameone.nl"); 
//ImageTTFText($plaatje, 13, 0, $x_coordinaat + $offset_x, $y_coordinaat + $offset_y, $black, $font, "http://www.gameone.nl"); 

// Schrijf de ouput weg  
ImageJPEG($plaatje);  
ImageDestroy($plaatje);

En nog iets, de ImageTTFText(); geeft ook alleen maar vage kleuren... Voorbeeld van wat het script print is hier http://www.gameone.nl/Screen.php3?action=full&id=1&titel_klein=max_payne te vinden. Erg vaag...

zeroxcool.net - curity.eu


  • zeroxcool
  • Registratie: Januari 2001
  • Laatst online: 04-09 13:39
niemand?

zeroxcool.net - curity.eu


  • bras
  • Registratie: Oktober 2000
  • Laatst online: 11-09 16:22
PHP:
1
2
3
<?
$white  = ImageColorAllocate($plaatje, 255, 255, 255);
?>

dit ergens aan het begin weg zetten?

edit:
hmmm, niet gezien dat dat er al stond... sowwy

[edit 2]mischien hoofd- kleine letters? [/edit 2]

"When you find yourself in the company of a halfling and an ill-tempered Dragon, remember, you do not have to outrun the Dragon...you just have to outrun the halfling."


Verwijderd

Volgens mij moet je de kleur van de background eerst ff allocaten en dan de textkleur. Meende dat uit de comments te hebbengehaald van imagestring in de manual.

Dus eerst de bg color allocaten, dan de textkleuren.

  • zeroxcool
  • Registratie: Januari 2001
  • Laatst online: 04-09 13:39
Maar ik heb geen bg color...

zeroxcool.net - curity.eu