anonīms Posted January 18, 2009 Report Posted January 18, 2009 <?php include "_inc_/config.php"; header("Content-type: image/png"); $string = intval($_GET['text']); $kuul=mysql_fetch_object(mysql_query("SELECT lietotajvards, tautiba, kills, deaths FROM gamefarm_lietotaji WHERE id = {$string}")); $teksts = "<img src='.../images/flags/".$kuul->tautiba.".gif' alt='' /> ".$kuul->lietotajvards.""; $im = imagecreatefrompng(".../design/stats_background.png"); $orange = imagecolorallocate($im, 0, 0, 0); $px = (imagesx($im) - 7.5 * strlen($string)) / 2; imagestring($im, 3, $px, 4, $teksts, $orange); imagepng($im); imagedestroy($im); ?> Kā ir iespējams iedabūt iekšā, lai rādītos bilde (šajā gadijumā karogs) ?
Kavacky Posted January 18, 2009 Report Posted January 18, 2009 imagecreatefromXXX('karogabilde.xxx'); imagecopy(...);
anonīms Posted January 18, 2009 Author Report Posted January 18, 2009 (edited) Hmmm, man viņš rāda to flagu, nevis flagu iekšs otras bildes (pirms lietotājvārda) <?php include "_inc_/config.php"; header("Content-type: image/png"); $string = intval($_GET['text']); $kuul=mysql_fetch_object(mysql_query("SELECT lietotajvards, tautiba, kills, deaths FROM gamefarm_lietotaji WHERE id = {$string}")); $flags = imagecreatefromgif('http://www.gamefarm.lv/images/flags/'.$kuul->tautiba.'.gif'); $dest = imagecreatetruecolor(16, 11); imagecopy($dest, $flags, 0, 0, 0, 0, 16, 11); $karogs = imagegif($dest); imagedestroy($dest); $teksts = " ".$karogs." ".$kuul->lietotajvards." ".$kuul->tautiba.""; $im = imagecreatefrompng("http://www.gamefarm.lv/design/stats_background.png"); $text_color = imagecolorallocate($im, 0, 0, 0); $px = (imagesx($im) - 7.5 * strlen($string)) / 2; imagestring($im, 3, $px, 4, $teksts, $text_color); imagepng($im); imagedestroy($im); ?> http://www.gamefarm.lv/stat/2.png Edited January 18, 2009 by anonīms
Recommended Posts