当前位置: 首页 > news >正文

网站顶端flash/百度快速收录软件

网站顶端flash,百度快速收录软件,三明网站建设,单页网站模板做seo1.引入GD库,在php.ini中吧extensionphp_gd2.dll中把前面;去掉。print_r(gd_info());打印出来相关信息。 学GD库重在理解,1.画图的过程 2,计算机的坐标体系GD库画图典型流程1.创建画布 imagecreatetruecolor();也可以打开一张图片作画布 ima…

1.引入GD库,在php.ini中吧extension=php_gd2.dll中把前面;去掉。print_r(gd_info());打印出来相关信息。

学GD库重在理解,1.画图的过程    2,计算机的坐标体系
GD库画图典型流程
1.创建画布    imagecreatetruecolor();
也可以打开一张图片作画布 imagecreatefromjpeg($path);
2.创建颜料 imagecolorcate();
3.画图泼墨渲染 imagefill();
画直线 imageline()
4.保持 imagepng()    imagejpeg()     imagegif();
5.销毁画布,释放资源 imagedestroy($img);
 一些基本操作
代码如下:
 1 <?php 
 2     // //创建画布
 3     // $width = 500;
 4     // $height = 300;
 5     // $img = imagecreate($width, $height);
 6 
 7     // //画笔颜色设置
 8     // $red = imagecolorallocate($img, 255, 0,0);
 9     // $orange = imagecolorallocate($img,255,125,0);
10     // $yellow = imagecolorallocate($img,255,255,0);
11     // $green = imagecolorallocate($img,0,255,0);
12     // $blue = imagecolorallocate($img,0,0,255);
13     // $indigo = imagecolorallocate($img,0,255,255);
14     // $purple = imagecolorallocate($img,255,0,255);
15 
16     // $x1 = 0;
17     // $y1 = 0;
18     // $x2 = 5;
19     // $y2 = 5;
20 
21     // imagefill($img,$x1,$y1,$green);
22 
23     // imageline($img, $x1, $y1, $x2, $y2, $orange);
24 
25     /*
26     * 绘制椭圆
27     */
28 
29     $width = 500;
30     $height = 300;
31     //产生画布
32     $img = imagecreate($width, $height);
33 
34     //设置颜色
35     $orange = imagecolorallocate($img, 255, 125, 0);
36     $red = imagecolorallocate($img, 255, 0, 0);
37     $green = imagecolorallocate($img, 0, 255, 0);
38     //画布背景
39     $x2 = 500;
40     $y2 = 300;
41     imagefill($img, $x2, $y2, $orange);
42 
43     //绘制圆1
44     $cx = 100;
45     $cy = 60;
46     $w = 80;
47     $h = 80;
48     imageellipse($img, $cx, $cy, $w, $h, $green);
49 
50     //绘制圆2
51     $cx2 = 400;
52     $cy2 = 60;
53     $w2 = 80;
54     $h2 = 80;
55     imageellipse($img, $cx2, $cy2, $w2, $h2, $green);
56 
57     //绘制多边形
58     $points = array(
59         250,100,
60         300,150,
61         200,150
62         );
63     $num_points = count($points)/2;
64     imagepolygon($img, $points, $num_points, $green);
65 
66     //绘制圆弧
67     $cx3 = 250;
68     $cy3 = 200;
69     $w3 = 200;
70     $h3 = 150;
71     $s3 = 5;
72     $e3 = 175;
73     imagearc($img, $cx3, $cy3, $w3, $h3, $s3, $e3, $green);
74 
75     header("Content_type: image/png");
76     imagepng($img);        //输出图像
77     imagedestroy($img);        //释放与图像相关联的内存
78  ?>

 

生产随机验证码
代码如下
<?php $rand_num = rand();        //生成随机数$str = md5($rand_num);  //取得该数md5值$num_code = 5;        //验证码字符数$str_code = substr($str, 0, $num_code);     //从md5截取字符串作为验证码$width = 120;        //验证码图片宽度$height = 55;        //高度$img = imagecreate($width, $height);    //创建图像句柄$bg_color = imagecolorallocate($img, 255, 255, 255);      //背景色$border_color = imagecolorallocate($img, 0, 0, 0);        //前景色imagerectangle($img, 0, 0, $width-1, $height-1, $border_color);    //绘制边框//随机字体颜色for ($i=0; $i < $num_code; $i++) { # code...$str_color = imagecolorallocate($img, rand(0,255), rand(0,255), rand(0,255));$font_size = 10;$str_x = floor( ($width / $num_code) * $i ) + rand(0,5);$str_y = rand( 2,$height - 15 );imagestring($img, $font_size, $str_x, $str_y, $str_code[$i], $str_color);}//绘制随机干扰点颜色$num_disturb_points = 200;for ($i=0; $i < $num_disturb_points; $i++) { # code...$point_color = imagecolorallocate($img, rand(0,255), rand(0,255), rand(0,255));$point_x = rand(2,$width - 2);$point_y = rand(2,$height - 2);imagesetpixel($img, $point_x, $point_y, $point_color);}//绘制随机颜色直线$line = 5;for ($i=0; $i < $line; $i++) { # code...$line_color = imagecolorallocate($img, rand(0,255), rand(0,255), rand(0,255));$line_x1 = rand(2,$width - 2);$line_y1 = rand(2,$height - 2);$line_x2 = rand(2,$width - 2);$line_y2 = rand(2,$height - 2);imageline($img, $line_x1, $line_y1, $line_x2, $line_y2, $line_color);}header("Content-type: image/png");        //发送header信息imagepng($img);            //输出图像imagedestroy($img);        //释放与图像关联内存?>

 

转载于:https://www.cnblogs.com/zzg521/p/4135910.html

http://www.jmfq.cn/news/4925575.html

相关文章:

  • 企业如何做网站外包多少钱/什么是seo什么是sem
  • win2012做网站/北京百度推广代理公司
  • 北京服务器租用/seo优化方案总结
  • 宋庄网站建设/郑州seo顾问外包公司
  • 泊头做网站的/上海官网seo
  • 经典网站代码/百度一下官网首页
  • 做时时彩网站平台软件/淘宝网店怎么运营起来
  • wordpress名言插件/搜索引擎关键词优化技巧
  • 云南手机网站制作/自助建站系统模板
  • 如何建外贸网站/百度网页制作
  • 建设网站需要几个人完成/sem运营
  • 台州专业制作网站/宁波seo服务推广
  • 临沂建设规划局网站/今天的新闻 最新消息
  • 在哪个网站做流程图比较好看/网络推广网络营销和网站推广的区别
  • 如何做外贸网站推广/怎么在百度发布个人简介
  • 网站开发还有哪些/百度开户渠道商哪里找
  • 做网站机构图用什么工具/网络推广有哪些途径
  • 企业网站建设分析/中国网评中国网评
  • 快速的网站开发工具/全国今日新增疫情
  • 一般网站服务费怎么入账做分录/什么是关键词
  • 做网站建设价格/cps游戏推广平台
  • 凡科做网站技巧/小熊猫seo博客
  • 漳州市城乡建设局网站6/推广项目网站
  • 台州市住房和城乡建设局网站/服务营销策略
  • 哪里有微信网站建设/长尾关键词挖掘爱站网
  • 怎么做投资网站不违法/首页优化排名
  • 小城建设的网站/比较靠谱的推广平台
  • 合肥市门窗工程在哪个网站接活做/网站推广教程
  • 比较有名的网站建设公司/渠道营销推广方案
  • 官网站内优化怎么做/湖南网络优化