(PHP 4 >= 4.0.7, PHP 5, PHP 7)
imagegd2 — �� GD2 ͼ���������������ļ�
$image
[, string $filename
[, int $chunk_size
[, int $type = IMG_GD2_RAW
]]] ) : bool
imagegd2() ��һ�� GD ͼ�������
filename��image
image��ͼ������(����imagecreatetruecolor())���ص�ͼ����Դ��
filename�ļ������·�������δ���û�Ϊ NULL������ֱ�����ԭʼͼ������
chunk_sizeChunk size.
type
������
IMG_GD2_RAW �� IMG_GD2_COMPRESSED��Ĭ��Ϊ
IMG_GD2_RAW��
�ɹ�ʱ���� TRUE�� ������ʧ��ʱ���� FALSE��
Example #1 ���һ�� GD2 ͼ��
<?php
// Create a blank image and add some text
$im = imagecreatetruecolor(120, 20);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, "A Simple Text String", $text_color);
// Output the image
imagegd2($im);
// Free up memory
imagedestroy($im);
?>
Example #2 ���� GD2 ͼ��
<?php
// Create a blank image and add some text
$im = imagecreatetruecolor(120, 20);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, "A Simple Text String", $text_color);
// Save the gd2 image
// The file format for GD2 images is .gd2, see http://www.libgd.org/GdFileFormats
imagegd2($im, 'simple.gd2');
// Free up memory
imagedestroy($im);
?>
Note: �˺�����Ҫ GD 2.0.1 ����߰汾(�Ƽ� 2.0.28 �����߰汾)��
Note:
GD2 ��ʽһ������������ͼ���е�һ����ʱ���졣ע�� GD2 ��ʽֻ�����ڼ����� GD2 ��Ӧ�ó���
| �汾 | ˵�� |
|---|---|
| 4.3.2 |
����˲��� chunk_size �� type��
|