imagecreate

(PHP 4, PHP 5, PHP 7)

imagecreate新建一个基于调色板的图像

说明

imagecreate ( int $x_size , int $y_size ) : resource

imagecreate() 返回一个图像标识符,代表了一幅大小为 x_sizey_size 的空白图像。

推荐使用 imagecreatetruecolor()

Example #1 新建一个新的 GD 图像流并输出图像

<?php
header
("Content-type: image/png");
$im = @imagecreate(10050)
    or die(
"Cannot Initialize new GD image stream");
$background_color imagecolorallocate($im255255255);
$text_color imagecolorallocate($im2331491);
imagestring($im155,  "A Simple Text String"$text_color);
imagepng($im);
imagedestroy($im);
?>

参见 imagedestroy()imagecreatetruecolor()

相关文章
php gd 和图像处理 函数 取得 getimagesize,exif read data,exif thumbnail,exif imagetype 所返回的图像类型的 mime 类型php gd 和图像处理 函数 以 wbmp 格式将图像输出到浏览器或文件php gd 和图像处理 函数 返回经过仿射变换后的图像,剪切区域可选php gd 和图像处理 函数 取消图像颜色的分配php gd 和图像处理 函数 使一个图像中调色板版本的颜色与真彩色版本更能匹配php gd 和图像处理 函数 取得一幅图像的调色板中颜色的数目php gd 和图像处理 函数 拷贝部分图像并调整大小php gd 和图像处理 函数 新建一个基于调色板的图像php gd 和图像处理 函数 从 gd 文件或 url 新建一图像php gd 和图像处理 函数 从 gd2 文件或 url 新建一图像php gd 和图像处理 函数 从给定的 gd2 文件或 url 中的部分新建一图像php gd 和图像处理 函数 从字符串中的图像流新建一图像php gd 和图像处理 函数 新建一个真彩色图像php gd 和图像处理 函数 销毁一图像php gd 和图像处理 函数 对 gd 图像应用 gamma 修正php gd 和图像处理 函数 将 gd 图像输出到浏览器或文件php gd 和图像处理 函数 将 gd2 图像输出到浏览器或文件php gd 和图像处理 函数 将调色板从一幅图像拷贝到另一幅php gd 和图像处理 函数 以 png 格式将图像输出到浏览器或文件php gd 和图像处理 函数 将真彩色图像转换为调色板图像
关注编程学问公众号