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 和图像处理 函数 取得图像类型的文件后缀php gd 和图像处理 函数 取得 getimagesize,exif read data,exif thumbnail,exif imagetype 所返回的图像类型的 mime 类型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 和图像处理 函数 使用 freetype 2 字体将文本写入图像php gd 和图像处理 函数 将调色板从一幅图像拷贝到另一幅php gd 和图像处理 函数 设定画线用的画笔图像php gd 和图像处理 函数 将真彩色图像转换为调色板图像php gd 和图像处理 函数 将 webp 格式的图像输出到浏览器或文件php gd 和图像处理 函数 将 xbm 图像输出到浏览器或文件php gd 和图像处理 函数 将 png 图像文件转换为 wbmp 图像文件
关注编程学问公众号