imagecreatefromgd2

(PHP 4 >= 4.0.7, PHP 5, PHP 7)

imagecreatefromgd2 — �� GD2 �ļ��� URL �½�һͼ��

˵��

imagecreatefromgd2 ( string $filename ) : resource

�� GD2 �ļ��� URL �½�һͼ��

Tip

��������fopen ��װ�����ڴ˺����У� URL ����Ϊ�ļ������������ָ���ļ������ fopen()������ wapper �IJ�ͬ������μ� ֧�ֵ�Э��ͷ�װЭ����ע�����÷�������ṩ��Ԥ���������

����

filename

GD2 ͼ���·����

����ֵ

�ɹ��󷵻�ͼ����Դ,ʧ�ܺ󷵻� FALSE ��

����

Example #1 imagecreatefromgd2() ����

<?php
// ���� gd2 ͼ��
$im = imagecreatefromgd2('./test.gd2');


// ��ͼ����Ӧ��Ч����
// ����������У�����汾Ϊ PHP5+ ��תͼ����ɫ
if(function_exists('imagefilter'))
{
    
imagefilter($im, IMG_FILTER_NEGATE);
}

// ����ͼ��
imagegd2($im, './test_updated.gd2');
imagedestroy($im);
?>

ע��

Note: �˺�����Ҫ GD 2.0.1 ����߰汾(�Ƽ� 2.0.28 �����߰汾)��

Warning

Windows �汾�� PHP �� 4.3.0 ��֮ǰ��֧��ͨ���˺�������Զ���ļ�����ʹ�Ѿ����� allow_url_fopen.