如何读取一个图片 显示出来? ? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 设置header为图片,然后读取图片文件,直接echo到浏览器. <?phpHeader("Content-type: image/gif");$im = imagecreate(400,30);$black = ImageColorAllocate($im, 0,0,0);$white = ImageColorAllocate($im, 255,255,255);imageline($im, 1, 1, 350, 25, $black);imagearc($im, 200, 15, 20, 20, 35, 190, $white);imagestring($im, 5, 4, 10, "Graph TEST!!", $white);ImageGif($im);ImageDestroy($im);?> //除了楼上的方法, 还可以这样, 看例子<?php//自己把图片url装载进$arrImage$arrImage[0] = '../image/1.gif';$arrImage[1] = '../image/2.gif';$arrImage[2] = '../image/3.gif';//输出图片$str = '';foreach($arrImage as $value){ $str.= '<img src="'.$value.'" />';}echo $str;?> 问题看错了!<? $file="xxx.jpg"; $image=fread(fopen($file,r),filesize($file)); header("content-type:image/JPEG",true); echo $image;?> ?如何读取一个图片 显示出来?不用那么复杂吧比如a.php自动生产一张图片<img src="http://xxxxx.xxx.com/xxx/a.php">比如读取已知路径图片<img src="http://xxxxx.xxx.com/xxx/a.jpg"> 求教一下取数据的问题 [原创]php+ajax实现模拟Win文件管理系统 请问如何在windows7下安装配置php以及mysql,说细点,我是初学者 php入门哪些书比较好? preg_replace 正则替换一块的问题 php求救,做不出来就没工作了! *********[HELP]PHP 一些问题******************** 如何确实一个php页面不是从另一个htm页面的frame中连接显示? 关于购物车程序! 肯定很简单,但我却不知道的问题!头痛!! 诸位高手帮个忙, curl https的问题
<?php
Header("Content-type: image/gif");
$im = imagecreate(400,30);
$black = ImageColorAllocate($im, 0,0,0);
$white = ImageColorAllocate($im, 255,255,255);
imageline($im, 1, 1, 350, 25, $black);
imagearc($im, 200, 15, 20, 20, 35, 190, $white);
imagestring($im, 5, 4, 10, "Graph TEST!!", $white);
ImageGif($im);
ImageDestroy($im);
?>
//除了楼上的方法, 还可以这样, 看例子<?php//自己把图片url装载进$arrImage
$arrImage[0] = '../image/1.gif';
$arrImage[1] = '../image/2.gif';
$arrImage[2] = '../image/3.gif';//输出图片
$str = '';
foreach($arrImage as $value){
$str.= '<img src="'.$value.'" />';
}
echo $str;
?>
问题看错了!
<? $file="xxx.jpg";
$image=fread(fopen($file,r),filesize($file));
header("content-type:image/JPEG",true);
echo $image;
?>
不用那么复杂吧
比如a.php自动生产一张图片
<img src="http://xxxxx.xxx.com/xxx/a.php">
比如读取已知路径图片
<img src="http://xxxxx.xxx.com/xxx/a.jpg">