最新下载
热门教程
- 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);
?>
相关文章
- 搜狗手机输入法怎么调大小写字母 06-21
- breeno指令可以卸载吗 06-21
- 搜有红包怎么多得积分 06-21
- 华为nova11预计上市时间 06-21
- 云成绩如何注册账号 06-21
- UG10.0提示初始化错误 06-21