1

気象データを表示する画像を作成しようとしています:

<?php
header("Content-type: image/png");

$place = $_GET['place'];
$temp = $_GET['temp'];
$weather = $_GET['weather'];

$im_width = 150;
$im_height = 150;

$im = @imagecreate($im_width, $im_height);

$background_color = imagecolorallocate($im, 0, 0, 0);

$weather_im = imagecreatefrompng("images/". $weather .".png");
imagecopy($im, $weather_im, 0, 0, 0, 0, $im_width, $im_height);

$font = 'segoeui.ttf';
$font_color = imagecolorallocate($im, 255, 255, 255);

$temp_font_size = 24;

imagettftext($im, 16, 0, 5, $im_height-10, $font_color, $font, $place);
imagettftext($im, $temp_font_size, 1, $im_width-$temp_font_size, $im_height/2, $font_color, $font, $temp);

imagepng($im, '', 9);
imagedestroy($im);

?>

テキストを取得しましたが、他の画像 13 を追加すると、背景画像とその画像しかありません。イメージコピーを行う前に、テキストもありました:-/

4

0 に答える 0