GD and Image Функции
PHP Manual

imagecreatefromgd

(PHP 4 >= 4.0.7, PHP 5)

imagecreatefromgdCreate a new image from GD file or URL

Описание

resource imagecreatefromgd ( string $filename )

Create a new image from GD file or URL.

Съвет

Даден URL може да бъде използван като име на файл с тази функция ако fopen wrappers е включено. Виж fopen() за повече подробности относно начина, по който се задава име на файл и List of Supported Protocols/Wrappers за списък с поддържаните URL протоколи.

Параметри

filename

Path to the GD file.

Връщани стойности

Returns an image resource identifier on success, FALSE on errors.

Примери

Example #1 imagecreatefromgd() example

<?php
// Load the gd image
$im = @imagecreatefromgd('./test.gd');

// Test if the image was loaded
if(!is_resource($im))
{
     die(
'Unable to load gd image!');
}

// Do image operations here

// Save the image
imagegd($im'./test_updated.gd');
imagedestroy($im);
?>

Бележки

Предупреждение

Windows версиите на PHP преди PHP 4.3.0 не поддържат достъпа до отдалечени файлове посредством тази функция, дори и ако allow_url_fopen е включено.


GD and Image Функции
PHP Manual