PHP 地图区域图片 (狂想区)<?php
PHP 地图区域图片 (狂想区)
//+.- ---and all
PHP 地图区域图片 (狂想区)
$OD='ipd';
PHP 地图区域图片 (狂想区)
$newwidth = 80;
PHP 地图区域图片 (狂想区)
$newheight = 80;
PHP 地图区域图片 (狂想区)
$bmiparea =
PHP 地图区域图片 (狂想区)
$files=array(); 
PHP 地图区域图片 (狂想区)
if ($handle=opendir("$OD")){
PHP 地图区域图片 (狂想区)    
while(false !== ($file = readdir($handle))) {
PHP 地图区域图片 (狂想区)        
if ($file != "." && $file != "..") {
PHP 地图区域图片 (狂想区)            
if(substr($file,-3)=='png')
PHP 地图区域图片 (狂想区)                
$files[count($files)] = $file;
PHP 地图区域图片 (狂想区)            }
PHP 地图区域图片 (狂想区)        }
PHP 地图区域图片 (狂想区)    }
PHP 地图区域图片 (狂想区)
closedir($handle);
PHP 地图区域图片 (狂想区)
$random = rand(0,count($files)-1);
PHP 地图区域图片 (狂想区)
$im = imagecreate ( 155, 138 );
PHP 地图区域图片 (狂想区)
//imagefilledrectangle ( $im, 0, 0, 255, 255, 0);
PHP 地图区域图片 (狂想区)
$source = imagecreatefrompng('ipd/'.$files[$random]);
PHP 地图区域图片 (狂想区)
list($oldwidth, $oldheight= getimagesize('ipd/'.$files[$random]);
PHP 地图区域图片 (狂想区)
$bg = imagecolorallocate($im, 255, 255, 255);
PHP 地图区域图片 (狂想区)
$textcolor = imagecolorallocate($im, 0, 0, 0);
PHP 地图区域图片 (狂想区)imagecopyresized(
$im,$source,30,35,0,0,$newwidth,$newheight,$oldwidth,$oldheight);
PHP 地图区域图片 (狂想区)
//imagerectangle($im,30,20,120,98,$file);
PHP 地图区域图片 (狂想区)
$NM = 'Dosnake@Gmail.com';
PHP 地图区域图片 (狂想区)
$by = 'YOUR IP REGION:';
PHP 地图区域图片 (狂想区)
$IP = $_SERVER['REMOTE_ADDR'];
PHP 地图区域图片 (狂想区)imagestring(
$im, 5, 0.2, 0, "$NM", $textcolor);
PHP 地图区域图片 (狂想区)imagestring(
$im, 4, 13, 15, "$by", $textcolor);   
PHP 地图区域图片 (狂想区)imagestring(
$im, 4, 5, 123, "IP:$IP", $textcolor);
PHP 地图区域图片 (狂想区)
header("Content-type: image/png");
PHP 地图区域图片 (狂想区)imagepng(
$im);
PHP 地图区域图片 (狂想区)imagedestroy(
$im);
PHP 地图区域图片 (狂想区)
?>    

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

相关文章: