Witam
poniższy skrypt ma na celu nałożenie tekstu przesłanego przez $_POST na obrazek i to jak najbardziej działa, Tylko że tekst powinien pojawić się w kolorze białym a pojawia się jako szary :/ siedzę już nad tym od 3ech h i nie wiem co jest nie tak a nie znam za dobrze biblioteki gd. Będę wdzięczny za wszelką pomoc.
<?php
{
}
function createImgText ($string="", $fontsize=0, $marginX=0, $imgH=0 , $fontfile="", $imgColorHex="FF00FF", $txtColorHex="FF00FF",
$image_info)
{
if($string!=""){
Header("Content-type: image/png"); //
if( !$sz )
{
}
$image_w = $sz[0];
$image_h = $sz[1];
$spacing = 0;
$fontfile='./includes/'.$fontfile;
$line = array("linespacing" => $spacing); $box = @imageftbbox($fontsize,0,$fontfile,$string,$line)
$tw=$box[4]-$box[0]; //image width
$marginY = $imgH - (($imgH - $fontsize) / 2);
$imgWidth = $tw + (2*$marginX);
$im = @imagecreatefromgif('./images/'.$image_info['image']);
$arr = array("red" => 0xFF
& ($int >> 0x10), "green" => 0xFF & ($int >> 0x8),
"blue" => 0xFF & $int);
$black = ImageColorAllocate($im, $arr["red"], $arr["green"], $arr["blue"]);
$arr = array("red" => 0xFF
& ($int >> 0x10), "green" => 0xFF & ($int >> 0x8),
"blue" => 0xFF & $int);
$white = ImageColorAllocate($im, $arr["red"], $arr["green"], $arr["blue"]);
ImageFtText
($im, $fontsize, 0
, $marginX, $marginY, $white, $fontfile, $string, array()); ImagePng($im);
ImageDestroy($im);
}else{
}
}
createImgText ($tekst, 9, 50, 45, "arial.ttf", "FF00FF", "FFFFFF",$image_info);
?>
Ten post edytował rafii 7.03.2007, 14:49:57