Jump to content

Dynamic Image Text Colour Problem


Suscorch

Recommended Posts

<?php

Header("Content-Type: image/gif");

$ign = 'IGN: '.$_GET['ign'];
$lvl = 'Level: '.$_GET['lvl'];
$job = 'Job: '.$_GET['job'];
$wld = 'World: '.$_GET['wld'];

$myimage = ImageCreateFromGif('images/signature'.$_GET['image'].'.gif');

$colour = ImageColorAllocate($myimage, 255,0,0);

ImageString($myimage, 3, 12, 10, $ign, $colour);
ImageString($myimage, 3, 12, 32, $lvl, $colour);
ImageString($myimage, 3, 12, 54, $job, $colour);
ImageString($myimage, 3, 12, 76, $wld, $colour);

ImageGif($myimage);

ImageDestroy($myimage);

?>

Can anyone tell me please how to stop this code from outputting black text over the image, and start outputting red text, like I told it to?

 

Thank you in advance... I really am at the end of my tether x_X

Link to comment
https://forums.phpfreaks.com/topic/50083-dynamic-image-text-colour-problem/
Share on other sites

try this

 

 

<?php

Header("Content-Type: image/gif");

$ign = 'IGN: '.$_GET['ign'];
$lvl = 'Level: '.$_GET['lvl'];
$job = 'Job: '.$_GET['job'];
$wld = 'World: '.$_GET['wld'];

$myimage = ImageCreateFromGif('images/signature'.$_GET['image'].'.gif');

$colour = imagecolorallocate($myimage, 255,0,0); //changed

ImageString($myimage, 3, 12, 10, $ign, $colour);
ImageString($myimage, 3, 12, 32, $lvl, $colour);
ImageString($myimage, 3, 12, 54, $job, $colour);
ImageString($myimage, 3, 12, 76, $wld, $colour);

ImageGif($myimage);

ImageDestroy($myimage);

?>

 

**untested

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.