I have been trying to edit an image and add text to it , i have sucseeded , but the color of the text had changed from black to yellow and the transprent areas are black.
so i added the code bettween the lines of stars, which gets rid of the black, where it should do, but makes it blueish/grey and the font color remains the same.
please could you tell me why this is happening and how to make it display my text as black and transparency as transprent.
<?php
header ('content-type: image/png');
$im = imagecreatefrompng('bars/title_test.png');
********************************************
// added here got rid of black border, but it did not //make the fill white, like the back ground
imageAlphaBlending($im, true);
imageSaveAlpha($im, true);
// ************************
$fontpath = '/usr/www/users/mimi7818/fonts/';
$texttobeadded = "test text for button";
$x = 10;
$y = 30;
$color = imagecolorallocate ($im, 0,0,0);
imagettftext ($im,30,0,$x,$y,$color,'/usr/www/users/mimi7818/fonts/HIROSHT.TTF', $texttobeadded);
imagepng ($im);
?>
so i added the code bettween the lines of stars, which gets rid of the black, where it should do, but makes it blueish/grey and the font color remains the same.
please could you tell me why this is happening and how to make it display my text as black and transparency as transprent.
<?php
header ('content-type: image/png');
$im = imagecreatefrompng('bars/title_test.png');
********************************************
// added here got rid of black border, but it did not //make the fill white, like the back ground
imageAlphaBlending($im, true);
imageSaveAlpha($im, true);
// ************************
$fontpath = '/usr/www/users/mimi7818/fonts/';
$texttobeadded = "test text for button";
$x = 10;
$y = 30;
$color = imagecolorallocate ($im, 0,0,0);
imagettftext ($im,30,0,$x,$y,$color,'/usr/www/users/mimi7818/fonts/HIROSHT.TTF', $texttobeadded);
imagepng ($im);
?>