HomeMenu
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

imagegetclip

Description

The imagegetclip of Image for PHP get the clipping rectangle.

Syntax

imagegetclip(
    GdImage $image
): array

Parameters

image

A GdImage object, returned by one of the image creation functions, such as imagecreatetruecolor().

Return

The function returns an indexed array with the coordinates of the clipping rectangle which has the following entries:

x-coordinate of the upper left corner

y-coordinate of the upper left corner

x-coordinate of the lower right corner

y-coordinate of the lower right corner

Examples

1 · return

<?

$width = 100;
$height = 100;
$image = imagecreate($width, $height);

$x1 = 25;
$y1 = 25;
$x2 = 75;
$y2 = 75;
imagesetclip($image, $x1, $y1, $x2, $y2);

$return = imagegetclip($image);

print_r($return);
Array
(
    [0] => 25
    [1] => 25
    [2] => 75
    [3] => 75
)