Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 网站建设 > 网页制作 > 鼠洞验证 hole.mouse 之-----印象
【标  题】:鼠洞验证 hole.mouse 之-----印象
【关键字】:hole.mouse,-----
【来  源】:http://www.cublog.cn/u/15199/showart.php?id=276202

鼠洞验证 hole.mouse 之-----印象

Your Ad Here 今天做了一个新的 鼠洞验证 hole.mouse 表现形式,先看看图片效果吧
右侧的5个小一点的图是用来候选的,右边的是参照标准,我这个例子,
参照标准被放大了(就是变形了)







代码如下:

/*

 *生成印象风格鼠洞

 */

function holemouse(){
  Header("Content-type: image/gif");
  $im = @imagecreate(224, 40);
  $bc = imagecolorallocate($im, 255, 255, 255);
  $b = imagecolorallocate($im, 33, 99, 55);
  $c = imagecolorallocate($im, 66, 55, 55);
  for($i=2;$i<7 ;$i++ ){
    $j=33*$i-6;
    imagerectangle($im, $j, 5, $j+30, 34,$b);
    imagerectangle($im, $j+rand(1,23), 4+rand(1,23), $j+rand(1,23), 4+rand(1,23),$c);
    imagerectangle($im, $j+rand(1,23), 4+rand(1,23), $j+rand(1,23), 4+rand(1,23),$c);
    imagerectangle($im, $j+rand(1,23), 4+rand(1,23), $j+rand(1,23), 4+rand(1,23),$c);
  }
  $r=rand(2,6);
  $j=33*$r-5;
  $_SESSION['holemouse']=$r;//只需要保存序号就可以了
  $b = imagecolorallocate($im, 200, 99, 55);

  //下面是缩放变形,看你的变化了了

  imagecopyresized($im, $im, 5, 3, $j, 6, 37, 37, 28, 28);
  imagerectangle($im, 4, 1,43, 38,$b);
  imagegif($im);
  imagedestroy($im);
}

/*

 *老鼠进洞了---验证

 */

function mousehole(){
  $r=$_SESSION['
holemouse'];
  if($r===null) return false;
  $xy=explode(',',$_POST['
xy']);//假设传入的参数在这里,形如63,20
  $x=$xy[0]?$xy[0]:false;
  $y=$xy[1]?$xy[1]:false;
  if($x == false or $y == false) return false;
  $j=33*$r-5;
  if($x>=$j and $x<=$j+28 and $y>=6 and $y<=37){
    return true;
  }else
    return false;
}

One scripts to restore all metadevice over cluster:【上一篇】
文档对象模型(DOM):【下一篇】
【相关文章】
  • 宽带上网-----代理服务器设置
  • 企业应用系统总体设计-----面向对象方法
  • linux 系统管理之入门-----安装
  • oracle学习笔记(二)------函数
  • base64编码类------源代码(C#)
  • 文件系统识别器 -----翻译自IFS KIT Documentation
  • Java---Swing(1)---------------------JFrame
  • Java---Swing(2)---------------------JDialog
  • JAVA学习感悟(8)上------(类型检查)读书笔记
  • AT91RM9200引导程序的建立--------U-Boot1.1.4在AT91RM9200上的移植
  • 【随机文章】
  • 无需安装光盘 输入法也能巧妙添加
  • Eclipse开发struts完全指南(四)
  • Linux Fedro Core 5下PPPOE上网配置全记录
  • 在VB中直接用ODBC API访问数据库
  • Win32 ASM详解-多线程编程
  • UNIX下用awk对话单统计日消费额
  • 瑞星工程师郑重警告
  • CAM350 V8.0 快捷键
  • Windows XP 中浏览器的个性化设置
  • Combobox的常用消息及使用,可用它来任意改变QQ的性别
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 bbb软讯网络 All Rigths Reserved.