最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php imagecreatefromgif创建 gif图片
时间:2022-07-02 10:15:06 编辑:袖梨 来源:一聚教程网
imagecreatefromgif创建 gif图片
imagecreatefromgif($filename)
imagecreatefromgif()返回一个图像标识符代表从给定的文件名获得的图像
$filename是gif图片名称哦。
来看个实例
function LoadGif($imgname)
{
/* Attempt to open */
$im = @imagecreatefromgif($imgname);
/* See if it failed */
if(!$im)
{
/* Create a blank image */
$im = imagecreatetruecolor (150, 30);
$bgc = imagecolorallocate ($im, 255, 255, 255);
$tc = imagecolorallocate ($im, 0, 0, 0);
imagefilledrectangle ($im, 0, 0, 150, 30, $bgc);
/* Output an error message */
imagestring ($im, 1, 5, 5, 'Error loading ' . $imgname, $tc);
}
return $im;
}
header('Content-Type: image/gif');
$img = LoadGif('bogus.image');
imagegif($img);
imagedestroy($img);
?>
相关文章
- 冬季去杭州西湖旅游,更有可能欣赏到哪种美景 蚂蚁庄园今日答案1.12 08-05
- 蚂蚁庄园小课堂今日最新答案2026年1月12日 08-05
- 蚂蚁庄园小课堂2026年1月12日最新题目答案 08-05
- 在寒冷的冬天,湖里的鱼会冬眠吗 蚂蚁庄园今日答案1月12日 08-05
- 《我的世界手游》狐狸食物怎么获得-狐狸喜欢吃什么食物 08-05
- 幽灵捕捞是什么 神奇海洋1月12日答案最新 08-05