imagecreatetruecolor | 新建一个真彩色图像 | $im = @imagecreatetruecolor(50, 100) | resource imagecreatetruecolor ( int x_size, int y_size ) | 返回一个图像标识符,代表了一幅大小为 x_size 和 y_size 的黑色图像。 | |
imagecolorallocate | 为一幅图像分配颜色 | $background = imagecolorallocate($im, 255, 0, 0); | int imagecolorallocate ( resource image, int red, int green, int blue ) | 返回一个标识符,代表了由给定的 RGB 成分组成的颜色。 | |
imagefill | 区域填充 | imagefill($img,0,0,$white) | bool imagefill ( resource image, int x, int y, int color ) | 在 image 图像的坐标 x,y(图像左上角为 0, 0)处用 color 颜色执行区域填充(即与 x, y 点颜色相同且相邻的点都会被填充)。 | |
imagefilledarc | 画一椭圆弧且填充 | imagefilledarc($image, 50, $i, 100, 50, 0, 45, $darknavy, IMG_ARC_PIE); | bool imagefilledarc ( resource image, int cx, int cy, int w, int h, int s, int e, int color, int style ) | 在 image 所代表的图像中以 cx,cy(图像左上角为 0, 0)画一椭圆弧。如果成功则返回 TRUE,失败则返回 FALSE。w 和 h 分别指定了椭圆的宽和高,s 和 e 参数以角度指定了起始和结束点。 | |
imagefilledellpse | 画一椭圆并填充 | imagefilledellipse($image, 200, 150, 300, 200, $col_ellipse); | bool imagefilledellipse ( resource image, int cx, int cy, int w, int h, int color ) | 在 image 所代表的图像中以 cx,cy(图像左上角为 0, 0)为中心画一个椭圆。w 和 h 分别指定了椭圆的宽和高。椭圆用 color 颜色填充。如果成功则返回 TRUE,失败则返回 FALSE。 | |
imagefilledrectangle | 画一矩形闭关填充 | imagefilledrectangle($image, 200, 150, 300, 200, $col_ellipse); | bool imagefilledrectangle ( resource image, int x1, int y1, int x2, int y2, int color ) | 在 image 图像中画一个用 color 颜色填充了的矩形,其左上角坐标为 x1,y1,右下角坐标为 x2,y2。0, 0 是图像的最左上角。 | |
imagestring | 水平地画一行字符串 | imagestring($im, 5, 0, 0, “Hello world!”, $textcolor); | bool imagestring ( resource image, int font, int x, int y, string s, int col ) | 用 col 颜色将字符串 s 画到 image 所代表的图像的 x,y 坐标处(这是字符串左上角坐标,整幅图像的左上角为 0,0)。如果 font 是 1,2,3,4 或 5,则使用内置字体。 | |
imagestringup | 垂直地画一行字符串 | imagestringup($im,5,0,0,"Hello world!",$white) | bool imagestringup ( resource image, int font, int x, int y, string s, int col ) | | |
imagegettftext | 用 TrueType 字体向图像写入文本 | imagettftext($im, 20, 0, 11, 21, $grey, $font, $text); | array imagettftext ( resource image, float size, float angle, int x, int y, int color, string fontfile, string text ) | image 图片资源,size字体大小,angle角度,x第一个字符的水平坐标,y第一个字符的垂直坐标,color颜色索引,fontfile使用的TrueType字体路径,text文本字符串 | |
imagepng | 以 PNG 格式将图像输出到浏览器或文件 | $im = imagecreatefrompng("test.png"); imagepng($im); | bool imagepng ( resource image [, string filename] ) | 将 GD 图像流(image)以 PNG 格式输出到标准输出(通常为浏览器),或者如果用 filename 给出了文件名则将其输出到该文件。 | |
imagecopyresampled | 重采样拷贝部分图像并调整大小 | imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height); | bool imagecopyresampled ( resource dst_image, resource src_image, int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h ) | 将一幅图像中的一块正方形区域拷贝到另一个图像中,平滑地插入像素值,因此,尤其是,减小了图像的大小而仍然保持了极大的清晰度。如果成功则返回 TRUE,失败则返回 FALSE。 | |
imagedestory | 销毁一图像 | imagedestory($im) | bool imagedestroy ( resource image ) | 释放与 image 关联的内存。image 是由图像创建函数返回的图像标识符, | |