imagecreatefromgd2part

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

imagecreatefromgd2partCreate a new image from a given part of GD2 file or URL

Beschreibung

imagecreatefromgd2part ( string $filename , int $x , int $y , int $width , int $height ) : GdImage|false

Create a new image from a given part of GD2 file or URL.

Tipp

Mit dieser Funktion können Sie eine URL als Dateinamen verwenden, falls Sie fopen wrappers aktiviert haben. Mehr Details dazu, wie Sie den Dateinamen angeben müssen, finden Sie bei fopen(). Eine Liste der unterstützten URL-Protokolle, die Fähigkeiten der verschiedenen Wrapper, Hinweise zu deren Verwendung und Informationen zu den eventuell vorhandenen vordefinierten Variablen finden Sie unter Unterstützte Protokolle und Wrapper.

Parameter-Liste

filename

Path to the GD2 image.

x

x-coordinate of source point.

y

y-coordinate of source point.

width

Breite der Quelle.

height

Höhe der Quelle.

Rückgabewerte

Gibt im Erfolgsfall eine Bildresource zurück, im Fehlerfall false.

Changelog

Version Beschreibung
8.0.0 On success, this function returns a GDImage instance now; previously, a resource was returned.

Beispiele

Beispiel #1 imagecreatefromgd2part() example

<?php
// 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'44, ($image[0] / 2) - 6, ($image[1] / 2) - 6);

// Do an image operation, in this case we emboss the image
if(function_exists('imagefilter'))
{
    
imagefilter($imIMG_FILTER_EMBOSS);
}

// Save optimized image
imagegd2($im'./test_emboss.gd2');
imagedestroy($im);
?>

Anmerkungen

Warnung

Die GD und GD2 Bildformate sind proprietäre Bildformate von libgd. Sie sind als veraltet anzusehen, und sollten nur zu Entwicklungs- und Testzwecken verwendet werden.

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top