php GD库的使用:处理图像的功能
2017-10-19 01:25
477 查看
php GD库的使用:处理图像的功能
使用:1.画布 2.画笔 3.写字 4.画点/画线
建立图像:$image = imagecreatetruecolor(画布宽,画布高);
设置背景/字体颜色:$color = imagecolorallocate($image,0,0,0);
对画布背景填充颜色:imagefill($image,0,0,$color);
把字符串写在图像:imagestring($image,字体大小,x,y,'string',$color);
画点:imagesetpixel($image,x,y,$color);
画线:imageline($image,x1,y1,x2,y2,$color);
输出图像:header("Content-type:image/jprg");
imagejpeg($image);
释放内存:imagedestroy($image);
生成更好的随机数:mt_rand( );
引入自定义字体:imagettftext($image,大小,角度,x,y,$color,$font,'string');
存内容到文本文件:file_put_contents($file(文件路径),$content);
file_set_contents($file);
使用:1.画布 2.画笔 3.写字 4.画点/画线
建立图像:$image = imagecreatetruecolor(画布宽,画布高);
设置背景/字体颜色:$color = imagecolorallocate($image,0,0,0);
对画布背景填充颜色:imagefill($image,0,0,$color);
把字符串写在图像:imagestring($image,字体大小,x,y,'string',$color);
画点:imagesetpixel($image,x,y,$color);
画线:imageline($image,x1,y1,x2,y2,$color);
输出图像:header("Content-type:image/jprg");
imagejpeg($image);
释放内存:imagedestroy($image);
生成更好的随机数:mt_rand( );
引入自定义字体:imagettftext($image,大小,角度,x,y,$color,$font,'string');
存内容到文本文件:file_put_contents($file(文件路径),$content);
file_set_contents($file);
相关文章推荐
- PHP扩展之图像处理1——GD库使用及相关函数
- 数字图像处理 CImage类的使用与封装(jpg png gif tif bmp等格式图像的加载、数据读写、保存等功能)
- php编程之gd库图像处理(一)---gd库函数大全手册
- PHP图像处理之使用imagecolorallocate()函数设置颜色例子
- PHP图形图像处理之初识GD库
- PHP使用GD库生成图像验证码
- PHP图像处理:缩略图,打水印,裁剪等功能
- php使用高斯算法实现图片的模糊处理功能示例
- PHP GD库相关图像生成和处理函数
- PHP课程十大 PHP图像处理功能和实现的验证码
- [PHP] GD库(一):图像处理
- PHP图像处理(二) GraphicsMagick 安装扩展及使用方法
- 使用PHP GD库绘制图像,不显示的问题
- PHP基于GD库的图像处理方法小结
- 【PHP学习】GD库分析(图像生成和处理)
- PHP扩展之图像处理3——ImageMagick使用及相关类和方法
- PHP的gd库(图像生成和处理)的应用
- 使用gd库实现php服务端图片裁剪和生成缩略图功能分享
- PHP GD库相关图像生成和处理函数小结
- Linux环境下如何使用PHP处理图像