imagecreatefromgd2
(PHP 4 >= 4.0.7, PHP 5, PHP 7)
imagecreatefromgd2 — Создание нового изображения на основе GD2 или URL
Описание
Создание нового изображения на основе GD2 или URL.
Для этой функции вы можете использовать URL в качестве имени файла, если была включена опция fopen wrappers. Смотрите более подробную информацию об определении имени файла в описании функции fopen() . Смотрите также список поддерживаемых оберток URL, их возможности, замечания по использованию и список предопределенных констант в разделе Поддерживаемые протоколы и обертки.
Список параметров
Путь к GD2 изображению.
Возвращаемые значения
Возвращает ресурс изображения в случае успеха, или FALSE в случае ошибки.
Примеры
Пример #1 Пример использования imagecreatefromgd2()
// загрузка gd2 изображения
$im = imagecreatefromgd2 ( ‘./test.gd2’ );
// применение эффекта к изображению, этот код
// инвертирует цвета в PHP 5+
if( function_exists ( ‘imagefilter’ ))
<
imagefilter ( $im , IMG_FILTER_NEGATE );
>
imagecreatefromgd2part
Create a new image from a given part of GD2 file or URL
Description
Create a new image from a given part of GD2 file or URL.
A URL can be used as a filename with this function if the fopen wrappers have been enabled. See fopen for more details on how to specify the filename. See the Supported Protocols and Wrappers for links to information about what abilities the various wrappers have, notes on their usage, and information on any predefined variables they may provide.
Parameters
Path to the GD2 image.
x-coordinate of source point.
y-coordinate of source point.
Return Values
Returns an image resource identifier on success, FALSE on errors.
Examples
Example #1 imagecreatefromgd2part example
// For this example we need the image size before
$image = getimagesize ( ‘./test.gd2’ );
// Create the image instance now we got the image
// sizes
$im = imagecreatefromgd2part ( ‘./test.gd2’ , 4 , 4 , ( $image [ 0 ] / 2 ) — 6 , ( $image [ 1 ] / 2 ) — 6 );
// Do an image operation, in this case we emboss the
// image if PHP 5+
if( function_exists ( ‘imagefilter’ ))
<
imagefilter ( $im , IMG_FILTER_EMBOSS );
>
// Save optimized image
imagegd2 ( $im , ‘./test_emboss.gd2’ );
imagedestroy ( $im );
?>
Notes
Note: This function requires GD 2.0.1 or later (2.0.28 or later is recommended).
Windows versions of PHP prior to PHP 4.3.0 do not support access of remote files via this function, even if allow_url_fopen is enabled.
imagecreatefromgd2
(PHP 4 >= 4.0.7, PHP 5)
imagecreatefromgd2 — Create a new image from GD2 file or URL
Description
Create a new image from GD2 file or URL.
A URL can be used as a filename with this function if the fopen wrappers have been enabled. See fopen() for more details on how to specify the filename. See the List of Supported Protocols/Wrappers for links to information about what abilities the various wrappers have, notes on their usage, and information on any predefined variables they may provide.
Parameters
Path to the GD2 image.
Return Values
Returns an image resource >FALSE on errors.
Examples
Example #1 imagecreatefromgd2() example
// Load the gd2 image
$im = imagecreatefromgd2 ( ‘./test.gd2’ );
// Apply an effect on the image, in this
// case negate the image if PHP5+
if( function_exists ( ‘imagefilter’ ))
<
imagefilter ( $im , IMG_FILTER_NEGATE );
>
// Save the image
imagegd2 ( $im , ‘./test_updated.gd2’ );
imagedestroy ( $im );
?>
Notes
Note: This function requires GD 2.0.1 or later (2.0.28 or later is recommended).
Windows versions of PHP prior to PHP 4.3.0 do not support access of remote files via this function, even if allow_url_fopen is enabled.
FPublisher
Web-технологии: База знаний
Документация PHP
Последние поступления:
ТехЗадание на Землю
Размещена 14 марта 2020 года
Пpоект Genesis (из коpпоpативной пеpеписки)
Шпаргалка по работе с Vim
Размещена 05 декабря 2020 года
Vim довольно мощный редактор, но работа с ним не всегда наглядна.
Например если нужно отредактировать какой-то файл например при помощи crontab, без знания специфики работы с viv никак.
Ошибка: Error: Cannot find a val >Размещена 13 сентабря 2020 года
Если возникает ошибка на centos 5 вида
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/
Linux Optimization
Размещена 30 июля 2012 года
Linux.yaroslavl.ru
| |||||||||||||||||||||||||||||
imagecreatefromgd2 — создание нового изображения из GD2-файла или URL. Описаниеresource imagecreatefromgd2 (string filename)
|