Jump to content
php.lv forumi

GD


anonīms

Recommended Posts

<?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)

 

?

Link to comment
Share on other sites

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 by anonīms
Link to comment
Share on other sites

×
×
  • Create New...