problem with transparent Image
Posted: Mon Sep 29, 2008 7:12 am
hi!
i m facing the Problem, i want transparent image of some width n height and text on that image...but when i m using
imageSaveAlpha($image, true);
ImageAlphaBlending($image, false); its not working...
so i had another code...
<?php
Header('Content-type: image/png');
//$size = 300;
//$Img=imagecreatetruecolor(100,30);
$Img = imagecreate(110,30);
$Gray = imagecolorallocatealpha($Img, 0, 0, 255, 10);
$text = 'Testing..';
imageFilledRectangle($Img,0,0,100,100,$Gray);
imagecolortransparent($Img,$Gray);
$font = 'Shelley_AllegroScript.ttf';
imagettftext($Img, 20, 0, 10, 20, $Gray, $font, $text);
//imagestring($Img,4,0,0,$text,$Gold);
//imagecolortransparent($Img,$Gray);
imagepng($Img);
ImageDestroy($Img);
?>
but i m getting diminished text....
i m facing the Problem, i want transparent image of some width n height and text on that image...but when i m using
imageSaveAlpha($image, true);
ImageAlphaBlending($image, false); its not working...
so i had another code...
<?php
Header('Content-type: image/png');
//$size = 300;
//$Img=imagecreatetruecolor(100,30);
$Img = imagecreate(110,30);
$Gray = imagecolorallocatealpha($Img, 0, 0, 255, 10);
$text = 'Testing..';
imageFilledRectangle($Img,0,0,100,100,$Gray);
imagecolortransparent($Img,$Gray);
$font = 'Shelley_AllegroScript.ttf';
imagettftext($Img, 20, 0, 10, 20, $Gray, $font, $text);
//imagestring($Img,4,0,0,$text,$Gold);
//imagecolortransparent($Img,$Gray);
imagepng($Img);
ImageDestroy($Img);
?>
but i m getting diminished text....