zoukankan      html  css  js  c++  java
  • PHP 地图区域图片 (狂想区)

    <?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 = 'Dosnake@Gmail.com';
    $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  继续完善中...  存档

  • 相关阅读:
    解决VS2012新建MVC4等项目时,收到加载程序集“NuGet.VisualStudio.Interop…”的错误
    BOM 清除
    sleep和Sleep区别
    出现error: stray ‘357’ in program的根源
    vi 复制或剪切多行超级强大方法
    CentOS乱码解决方法
    VBS实现文本文件按行数拆分的脚本
    python-门户应用状态检查脚本
    HTA+VBS实现的话单核查小工具
    oracle 11g 安装
  • 原文地址:https://www.cnblogs.com/lsk/p/1201430.html
Copyright © 2011-2022 走看看