2023-05-12 开启多语言插件支持……

php imagecreate

php 苏 demo 2611℃ 0评论

(PHP 4, PHP 5, PHP 7)

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

说明

resource imagecreate ( int $x_size , int $y_size )

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

推荐使用 imagecreatetruecolor()

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

<?php
header("Content-type: image/png");
$im = @imagecreate(100, 50)
or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 255, 255, 255);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5,  "A Simple Text String", $text_color);
imagepng($im);
imagedestroy($im);
?>
打赏

转载请注明:苏demo的别样人生 » php imagecreate

   如果本篇文章对您有帮助,欢迎向博主进行赞助,赞助时请写上您的用户名。
支付宝直接捐助帐号oracle_lee@qq.com 感谢支持!
喜欢 (0)or分享 (0)