Blogger Information
Blog 7
fans 0
comment 2
visits 3795
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
GD函数库
ONEZERO
Original
796 people have browsed it

绘图步骤

1. 给出画布 2. 给出颜色(背景颜色) 3. 填充颜色 4. 输出图片 5. 释放资源

函数参考

-----------------------------------------------------------------------------------------------

imagecreatetruecolor(width, height)          // 给出画布

imagecolorallocate($image, red, green, blue)  // 分配颜色

imagefill($image, 起始点的X轴, y, color);                // 填充

imagepng($image, $path);                                  //图片的输出

imagedestroy($image);                                    // 释放资源

imagestring($image, $font, $x, $y, $string, $color);      // 输出字符串

imagettftext($image, 字体角度, $angle, $x, $y, $color, 字体目录, 内容);// 输出中文

imagesetpixel($image, $x, $y, $color)                     // 绘制单个点

imageline($image,起点X, 起点Y, 终点X, 终点y, $color);     // 绘制线

imagerectangle($image,起点X, 起点Y, 终点X, 终点y, $color)// 绘制矩形

-----------------------------------------------------------------------------------------------

缩列图

1. 加载图片

imagecreatefrompng($filename);

2. 获取图片信息

getimagesize($filename)

3. 图片复制

imagecopy(复图片, 复制图片,复x坐标, 复y坐标,复制x坐标, 复制y坐标, 复制宽度, 复制高度)

4. 图片缩放(生成缩略图)

imagecopyresized(复图片,源图片, 复起X,复起y, 原起X,原起y,复宽度,复高度,源宽度,源高度   )


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post