PHP图片处理类

// 画布生成

新建画布

imagecreate 新建一个基于调色板的图像
resource imagecreate(int xsize,int y_size)
imagecreatetruecolor 新建一个真彩色图像

基于已有文件或URL创建画布

imagecreatefromgd2 从GD2文件或URL新建一图像
imagecreatefromgd2part 从给定的GD2文件或URL中的部分新建一图像
imagecreatefromgd 从GD文件或URL新建一图像
imagecreatefromgif 由文件或URL创建一个新图象
imagecreatefromjpeg 由文件或URL创建一个新图象
imagecreatefrompng 由文件或URL创建一个新图象
imagecreatefromstring 从字符串中的图像流新建一图像
imagecreatefromwbmp 由文件或URL创建一个新图象
imagecreatefromxbm 由文件或URL创建一个新图象
imagecreatefromxpm 由文件或URL创建一个新图象
// 颜色分配
imagecolorallocate 为一幅图像分配颜色
int imagecolorallocate(resource image,int red, int green,int blue)
imagecolorallocatealpha 为一幅图像分配颜色 + alpha
imagecolordeallocate 取消图像颜色的分配
imagecolortransparent 将某个颜色定义为透明色
imagecolorat 取得某像素的颜色索引值
imagecolorclosest 取得与指定的颜色最接近的颜色的索引值
imagecolorclosestalpha 取得与指定的颜色加透明度最接近的颜色
imagecolorclosesthwb 取得与给定颜色最接近的色度的黑白色的索引
imagecolorexact 取得指定颜色的索引值
imagecolorexactalpha 取得指定的颜色加透明度的索引值
imagecolormatch 使一个图像中调色板版本的颜色与真彩色版本更能匹配
imagecolorresolve 取得指定颜色的索引值或有可能得到的最接近的替代值
imagecolorresolvealpha 取得指定颜色 + alpha 的索引值或有可能得到的最接近的替代值
imagecolorset 给指定调色板索引设定颜色
imagecolorsforindex 取得某索引的颜色
imagecolorstotal 取得一幅图像的调色板中颜色的数目
// 区域填充
imagefill 区域填充
bool imagefill(resource image,int x, int y,int color)
imagefilledarc 画一椭圆弧且填充
imagefilledellipse 画一椭圆并填充
imagefilledpolygon 画一多边形并填充
imagefilledrectangle 画一矩形并填充
imagefilltoborder 区域填充到指定颜色的边界为止
imagesettile 设定用于填充的贴图
// 图形创建
imagearc 画椭圆弧
imagechar 水平地画一个字符
imagecharup 垂直地画一个字符
imagedashedline 画一虚线
imageellipse 画一个椭圆
imageline 画一条线段
imagepolygon 画一个多边形
imagerectangle 画一个矩形
imagesetpixel 画一个单一像素
imagesx 取得图像宽度
imagesy 取得图像高度
// 画笔设置
imagesetbrush 设定画线用的画笔图像
imagesetstyle 设定画线的风格
imagesetthickness 设定画线的宽度
// 图形拷贝
imagecopy 拷贝图像的一部分
imagecopymerge 拷贝并合并图像的一部分
imagecopymergegray 用灰度拷贝并合并图像的一部分
imagecopyresampled 重采样拷贝部分图像并调整大小
imagecopyresized 拷贝部分图像并调整大小
// 字符创建
imagestring 水平地画一行字符串
imagestringup 垂直地画一行字符串
imagepsslantfont 倾斜某字体
imagefontheight 取得字体高度
imagefontwidth 取得字体宽度
imagettfbbox 取得使用 TrueType 字体的文本的范围
imageloadfont 载入一新字体
imagepsencodefont 改变字体中的字符编码矢量
imagepsextendfont 扩充或精简字体
// 导出画布为图片
imagegif 以GIF格式将图像输出到浏览器或文件
imagepng 以PNG格式将图像输出到浏览器或文件
imagejpeg 以JPEG格式将图像输出到浏览器或文件
imagewbmp 以WBMP格式将图像输出到浏览器或文件
通过header()发送 “Content-type: image/图片格式” 可以使PHP脚本直接输出图像。
header(“Content-type: image/gif”); imagegif($im);
imagegd 将 GD 图像输出到浏览器或文件
imagegd2 将 GD2 图像输出到浏览器或文件
// 释放画布资源
imagedestroy 销毁图像
// 图像信息
image_type_to_extension 取得图像类型的文件后缀
getimagesize 取得图像大小
imagesx 取得图像宽度
imagesy 取得图像高度
imageistruecolor 检查图像是否为真彩色图像
imagetypes 返回当前 PHP 版本所支持的图像类型
// 图像设置
imagerotate 用给定角度旋转图像
imagealphablending 设定图像的混色模式
imageantialias 是否使用抗锯齿(antialias)功能
imagefilter 对图像使用过滤器
imagegammacorrect 对 GD 图像应用 gamma 修正
imageinterlace 激活或禁止隔行扫描

imagecopyresampled 重采样拷贝部分图像并调整大小
bool imagecopyresampled ( resource dstimage,resource src_image , int dstx,int dst_y , int srcx,int src_y , int dstw,int dst_h , int srcw,int src_h )
imagecopymerge 拷贝并合并图像的一部分
bool imagecopymerge ( resource dstim,resource src_im , int dstx,int dst_y , int srcx,int src_y , int srcw,int src_h , int pct)getimagesizearraygetimagesize(string filename [, array &$imageinfo ] )

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值