|
imagecreate (PHP 3, PHP 4, PHP 5) imagecreate -- 新增一個基於調色板的圖像 說明resource imagecreate ( int x_size, int y_size )
imagecreate() 返回一個圖像標識符,代表了一幅大小為
x_size 和 y_size 的空白圖像。
推薦使用 imagecreatetruecolor()。
例子 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); ?>
|
|
參見 imagedestroy() 和
imagecreatetruecolor()。
| |