入门培训教程-php基础教程gd库图像处理_第1页
入门培训教程-php基础教程gd库图像处理_第2页
入门培训教程-php基础教程gd库图像处理_第3页
入门培训教程-php基础教程gd库图像处理_第4页
入门培训教程-php基础教程gd库图像处理_第5页
已阅读5页,还剩23页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

PHP中GDGDPHPHTMLJPEG是一种压缩标准的名字,通常是用来或者GIF原义是“图像互换格式”,是一种基于LZW景像形源//1建画 //建立空白景$whiteimageColorAllocate($im255255255//设置绘图色$blue=imageColorAllocate($im,0,0,//2始绘imageFill($im00 //绘制背imageLine($im00200200 //画imageString($im450150'Sales' //添加字//3出图imagePng PNG式将图像输//4放资imagecreateresourceimagecreate(intx_size,inty_sizepixel)。支持256imagecreatetruecolor--新建一个真彩像resourceimagecreatetruecolorintx_sizeinty_size)新建一个真彩像画布,需要GD2.0.1或更高版本GIFimagedestroyboolimagedestroy(resourceimageimagedestroy()imageimagecolorallocate语法:intimagecolorallocateresourceimage,red,intgreen,intblue$imimagecreatetruecolor(100 //创建画布的大小为 imagecolorallocate($im$imimagecreatetruecolor(100 //创建画布的大小为 imagecolorallocate($im,255,0,0$whiteimagecolorallocate($im0xFF0xFF0xFF);生成imagegifGIF语法:boolimagegifresourceimagestringfilename]imagejpegJPEG格式将图像输出到浏览器或文语法:boolimagejpegresourceimagestringfilenameintquality]]imagepngPNG语法:boolimagepngresourceimagestringfilename]imagewbmp--以WBMP格式将图像输出到浏览器语法:boolimagewbmpresourceimagestringfilename[,intforeground]])imagefill语法:boolimagefill(resourceimage,intx,inty,intcolor)imagefill()在image图像的坐标x,y(图像左上角为0,0)处用color颜色执行区域填充(x,yimagesetpixel语法:boolimagesetpixelresourceimageintx,intyintcolorimagesetpixel()在image图像中用color颜色在x,y坐标(图像左上角为0,0)上画一个点。imageline语法:boolimagelineresourceimage,intx1,inty1intx2,y2,intcolorimageline(colorimagex1,y1(0,0)imagerectangle语法:boolimagerectangleresourceimage,intx1,inty1,intx2,inty2,intcol)imagerectangle(col颜色image图像中画一个矩形,其左上角坐标为x1,y1,右下角坐标为x2,y2。图像的左上角坐标为0,0。imagefilledrectangle语法:boolimagefilledrectangleresourceimage,intx1,inty1,intx2,inty2,intcolor)imagefilledrectangle()image图像中画一个用color颜色填充了的矩形,其左上角坐标为x1,y1,右下角坐标为x2,y2。0,0是图像的最左上角。imagepolygon语法:boolimagepolygonresourceimage,arraypoints,intnum_points,intcolor)imagepolygon()在图像中创建一个多边形。points是一个PHP组,包含了多边形的各个顶点坐标,即points[0x0,points[1]=y0,points[2]=x1,points[3]=y1,以此类推。num_points是顶点的总数。imagefilledpolygon语法:boolimagefilledpolygonresourceimage,arraypoints,intnum_points,intcolor)imagefilledpolygon()在image图像中画一个填充了的多边形。points参数是一个按顺序包含有多边形各顶点的x和y坐标的数组。num_points参数是顶点的总数,必须大于3。imageellipse语法:boolimageellipseresourceimage,intcx,cy,intw,inth,intcolorimageellipse(image所代表的图像中画一个中心为cx,cy(00)的椭圆。w和h分别指定了椭圆的宽度和高度,椭圆的颜色由color指定。imagefilledellipse语法:boolimagefilledellipseresourceimage,intcx,intcy,intw,inth,intcolor)imagefilledellipse()在image所代表的图像中以cx,cy(图像左上角为0,0)为中心画一个椭圆。w和h分color颜色填充。如果成功则返回TRUE,失败则返回FALSE。imagearcboolimagearc(resourceimage,intcx,intcy,intw,inth,ints,inte,intcolor)imagearc()以cx,cy(图像左上角为0,0)为中心在image所代表的图像中画一个椭圆弧。w和h分别指定se参数以角度imagefilledarcboolimagefilledarcresourceimage,intcx,intcy,intw,inth,ints,inte,intcolor,intstyle)imagefilledarcimagecx,cy(00)TRUEFALSE。wh分别指定了椭圆的宽和高,s和e参数以角度指定了起始和结束点。style可 imagestring语法:boolimagestringresourceimage,intintx,inty,strings,intcolimagestringcolsimage表的图像的x,y坐标处(这是字符串左上角坐标,整幅0,0)font1,2,3,45,imagestringup语法:boolimagestringupresourceimage,intintx,inty,strings,intcolimagestringcolsimage所代表的图像的x,y座标处(图像的左上角为0,0)。如果font是1,2,3,4或5,则使用内置字体。imagechar语法:boolimagecharresourceimage,intfontintx,y,stringc,intcolorimagechar字符串c的第一个字符画在image指定的图像中,其左上角位于x,y(图像左上角为0,0),颜色为color。如果font是1,2,3,4或5,则使用内置的字体(更大的数字对应于更大的字体)imagecharup语法:boolimagecharupresourceimage,intfont,intinty,stringc,intcolorimagecharup(字符c垂直地画在image指定的图像上,位于x,y(图像左上角为0,0),颜色为color。如果font为1,2,3,4或5,则使用内置的字体。imagettftextTrueType语法:arrayimagettftextresourceimage,floatfloatangle,intx,inty,intcolor,stringfontfile,stringtext$im=imagecreatetruecolor(400 //创建400x300$whiteimagecolorallocate($im255255255);//$grey=imagecolorallocate($im128128, //$blackimagecolorallocate($im00, //imagefilledrectangle($im00,399,29, //$text=iconv("GB2312""UTF-8","LAMP$font= //指定字体,将系统中对应字体到当 imagettftext($im200,1221$grey$font //imagettftext($im,20,0,10,20,$black,$font,$text);//输出一个黑色的字符串header("Content-type:image/png");//通知浏览器将输出格式为PNG的图像 2.的绘制和使 yAutomatedPublicTuringtestto lComputersandHumansApart”(全自动区分计算机和人类的测试)的缩写,灌水,有效防止某个对某一个特定用户是现在很多通行的方式(比如招商银行的网上个人银行,社区)。设计的步3.PHP处3.1背景管3.2缩放和裁3.3添加水3.4旋转和翻3.1背景管从指定的文件或URL地址来新建一个图像。成功则应背景处理函数。resourceimagecreatefrompng(stringfilenamePNG文件或URLresourceimagecreatefromjpeg(stringfilenameJPEG文件或URLresourceimagecreatefromgif(stringfilenameGIFURLresourceimagecreatefromwbmp(stringfilenameWBMP文件或URLintimagesx(resourceimageintimagesy(resourceimagearraygetimagesize(string$filename[,array&$imageinfo])3.2缩放和裁boolimagecopyresampled(resource$dst_imageresource$src_image,int$dst_x,int$dst_y,$src_x,int$src_y,int$dst_w,int$dst_h,$src_w,int$src_h极大的清晰度。成功时返回TRUE,或者在失败时返回FALSE。其中dst_image和src_image分别是目标图像3.3添加水boolimagecopy(resource$dst_im,$src_im,int$dst_x,int$dst_y,int$src_x,$src_y,int$src_w

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论