duane Posted February 21, 2008 Share Posted February 21, 2008 My older brother helped me with this and now i'm stuck as he's not here. I'm really new to php, sois h but he knows more than me. I'm more a designer. He helped me set up a simple text logo generator on coolyankee.com It works how it should, but I need the image that is rendered to always resize to 125x35 I can't get it to work at all...ive searched for days online and asked so many people im almost about ready to give up. Below is the processing.php file that does everything, the image files are in a dif folder and there's the index.html that's all. Please help me out here as I really need this for friday afternoon. I appreciate your willingness to help. <? error_reporting(E_ERROR); error_reporting(0); header("Content-Type: image/png"); $str=$_POST["usertext"]; $style=$_POST["style"]; $ln=strlen($str); function Loadpng($imgname) { $im = @imagecreatefrompng($imgname); /* Attempt to open */ return $im; } $i=0; $wx=0; while ($i<$ln) { $text[$i]=substr($str,$i,1); $index[$i]=ord($text[$i]); $array = array('images/style', $style, '/', $index[$i], '.png'); $iurl = join("", $array); //echo $iurl; //$iurl="images/style1"; //$into="48"; //$iurl=$iurl."/".$into.".png"; //$iurl='images/style'.$style.'/'.$index[$i].'.png'; //echo $iurl; $img[$i] = Loadpng($iurl); $wx=$wx+imagesx($img[$i]); $i++; } $array = array('images/style', $style, '/logo.png'); $flog = join("", $array); $fl=Loadpng($flog); $wlh=imagesy($fl); $wlw=imagesx($fl); $array = array('images/style', $style, '/logoe.png'); $floge = join("", $array); $fle=Loadpng($floge); $wlhe=imagesy($fle); $wlwe=imagesx($fle); $wh=imagesy($img[0]); $wd=$wx+$wlw+$wlwe; $logo = imagecreatetruecolor($wd, $wh); $bgc = imagecolorallocate($logo, 255, 255, 255); imagefilledrectangle($logo, 0, 0, $wd, $wh, $bgc); $wx=0; $i=0; imagecopy($logo, $fl, $wx, 0, 0, 0, $wlw, $wh); $wx=$wx+$wlw; while ($i<$ln) { imagecopy($logo, $img[$i], $wx, 0, 0, 0, imagesx($img[$i]), $wh); $wx=$wx+imagesx($img[$i]); $i++; } imagecopy($logo, $fle, $wx, 0, 0, 0, $wlwe, $wh); imagepng($logo); die(); ?> Quote Link to comment Share on other sites More sharing options...
duane Posted February 21, 2008 Author Share Posted February 21, 2008 Double posting sorrrrry, only wanted to add that, if it was possible to have the image that ends up being saved do so but in only .gif format? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.