我正在尝试创建图像来呈现天气数据:
<?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之后,只有背景图片和那张图片。在我做影像学之前,我也有文字: - /