• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP 地图区域图片 (狂想区)

原作者: [db:作者] 来自: [db:来源] 收藏 邀请
<?php
//+.- ---and all
$OD='ipd';
$newwidth = 80;
$newheight = 80;
$bmiparea =
$files=array(); 
if ($handle=opendir("$OD")){
    
while(false !== ($file = readdir($handle))) {
        
if ($file != "." && $file != "..") {
            
if(substr($file,-3)=='png')
                
$files[count($files)] = $file;
            }
        }
    }
closedir($handle);
$random = rand(0,count($files)-1);
$im = imagecreate ( 155, 138 );
//imagefilledrectangle ( $im, 0, 0, 255, 255, 0);
$source = imagecreatefrompng('ipd/'.$files[$random]);
list($oldwidth, $oldheight= getimagesize('ipd/'.$files[$random]);
$bg = imagecolorallocate($im, 255, 255, 255);
$textcolor = imagecolorallocate($im, 0, 0, 0);
imagecopyresized(
$im,$source,30,35,0,0,$newwidth,$newheight,$oldwidth,$oldheight);
//imagerectangle($im,30,20,120,98,$file);
$NM = '[email protected]';
$by = 'YOUR IP REGION:';
$IP = $_SERVER['REMOTE_ADDR'];
imagestring(
$im, 5, 0.2, 0, "$NM", $textcolor);
imagestring(
$im, 4, 13, 15, "$by", $textcolor);   
imagestring(
$im, 4, 5, 123, "IP:$IP", $textcolor);
header("Content-type: image/png");
imagepng(
$im);
imagedestroy(
$im);
?>    

//0x001  一个根据IP显示图片的框架
//0x002     程序很easy,没遇到什么问题
//0x003  主要是在覆盖方面的顺序一直没有掌握好。
//0x004  继续完善中...  存档


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
【php页面表单提交】form校验后再提交,非ajax提交发布时间:2022-07-10
下一篇:
php代理请求发布时间:2022-07-10
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap