PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  
<imagecopyresizedimagecreatefromgd2>
Last updated: Mon, 16 Jul 2012

imagecreate

(PHP 3, PHP 4, PHP 5)

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

说明

resource imagecreate ( int x_size, int y_size )

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

推荐使用 imagecreatetruecolor()

例子 1. 新建一个新的 GD 图像流并输出图像

<?php
header
("Content-type: image/png");
$im = @imagecreate (50, 100)
   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()




<imagecopyresizedimagecreatefromgd2>
 Last updated: Mon, 16 Jul 2012
 
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://manual.phpv.net/
Last updated: Thu Jul 7 19:13:47 2005 CST