Pear::Image_Text - how to change background color from black

From: Date: Fri, 24 Sep 2004 14:39:56 +0000
Subject: Pear::Image_Text - how to change background color from black
Groups: php.general 
Request: Send a blank email to php-general+get-197783@lists.php.net to get a copy of this message
Guys Without hacking the pear library, does anyone know of any way (using the API) to change the background color of an image created with Image_Text from black? The bg is black because the image resource is created using imagecreatetruecolor() which returns a black image - this is on some of lines 550-569 in the pear source. I could change this, but I'm sure Tobias must have written in some way for this to be changed - the docs are of course minimal, and I can't find anything in the source. The text is nice and yellow, as specified in the code below, the only problem is changing the background from the lovely black default. Can anyone help me out? Code follows: Cheers Chris ----------------- <?php require_once 'Image/Text.php'; $options = array( 'image_type' => IMAGETYPE_JPEG,
                  'font_file' => 'flc.ttf',
                  'width' => 100,
                  'height' => 200,
                  'font_path' => '/path/to/font/file/',
                  'max_lines' => 1,
                  'x' => 2,
                  'y' => 2,
                  'font_size' => 12,
                );
$hImage =& Image_Text::construct("hello world", $options); $hImage->setColor('#FFFF00', 0); $hImage->init(); $hImage->render(); $hImage->display(); ?>

« previous php.general (#197783) next »