设为首页 加入收藏

TOP

php-gd库的使用——跟招财圆一起玩php(1)(二)
2017-10-10 11:31:39 】 浏览:7707
Tags:php-gd 使用 一起 php
is
->img,mt_rand(0,156),mt_rand(0,156),mt_rand(0,156)); 46 imageline($this->img,mt_rand(0,$this->width),mt_rand(0,$this->height),mt_rand(0,$this->width),mt_rand(0,$this->height),$color); 47 } 48 //雪花 49 for ($i=0;$i<100;$i++) { 50 $color = imagecolorallocate($this->img,mt_rand(200,255),mt_rand(200,255),mt_rand(200,255)); 51 imagestring($this->img,mt_rand(1,5),mt_rand(0,$this->width),mt_rand(0,$this->height),'*',$color); 52 } 53 } 54 //输出 55 private function outPut() { 56 header('Content-type:image/png'); 57 imagepng($this->img); 58 imagedestroy($this->img); 59 } 60 61 //对外生成 62 public function doimg() { 63 $this->createBg(); 64 $this->createCode(); 65 $this->createLine(); 66 $this->createFont(); 67 $this->outPut(); 68 } 69 70 //获取验证码 71 public function getCode() { 72 return strtolower($this->code); 73 } 74 } 75 ?> View Code

  今天就写到这里,下一篇加个水印旋转下

首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇php-gd库的使用——跟招财圆一起.. 下一篇PHP-生成缩略图和添加水印图-学习..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目