Вход Регистрация
Файл: ewar/itemImage.php
Строк: 18
<?

    
include("includes/config.php");
    
    
$id = (int) $_GET['id'];
    
$smith = (int) $_GET['smith'];
    
    if (
$smith < 0 or $smith > 7) {
    
        
$smith = 1;
    
    }
    
    
$dest_image = imagecreatetruecolor(50,50);
    
    
imagesavealpha($dest_image, true);
    
    
$trans_background = imagecolorallocatealpha($dest_image, 0, 0, 0, 127);
    
    
imagefill($dest_image, 0, 0, $trans_background);
    
    
$a = imagecreatefrompng("img/items/$id.png");
    
$smith ? $b = imagecreatefrompng("img/items/smith/$smith.png") : '';
    
    
imagecopy($dest_image, $a, 0, 0, 0, 0, 50, 50);
    
    
$smith ? imagecopy($dest_image, $b, 0, 0, 0, 0, 50, 50) : '';
    
    
header('Content-Type: image/png');
    
    
imagepng($dest_image);
    
imagedestroy($a);
    
    
$smith ? imagedestroy($b) : '';
    
    
imagedestroy($dest_image);

?>
Онлайн: 0
Реклама