PHP | Imagick resetImagePage() Function
The Imagick::resetImagePage() function is an inbuilt function in PHP which is used to reset the image page.
Syntax:
bool Imagick::resetImagePage( string $page )
Parameters: This function accepts a single parameter $page which holds the page definition in form of WxH+x+y, where W is for width, H is for height, x is for x-coordinate and y is for y-coordinate.
Return Value: This function returns TRUE on success.
Exceptions: This function throws ImagickException on error.
Below programs illustrate the Imagick::resetImagePage() function in PHP:
Program 1:
<?php
$imagick = new Imagick(
$imagick ->resetImagePage( '768x147+2+2' );
$page = $imagick ->getImagePage();
print ( "<pre>" .print_r( $page , true). "</pre>" );
?>
|
Output:
Array
(
[width] => 768
[height] => 147
[x] => 2
[y] => 2
)
Program 2:
<?php
$imagick = new Imagick(
$imagick ->resetImagePage( '800x300+1+1' );
$page = $imagick ->getImagePage();
print ( "<pre>" .print_r( $page , true). "</pre>" );
?>
|
Output:
Array
(
[width] => 800
[height] => 300
[x] => 1
[y] => 1
)
Reference: https://www.php.net/manual/en/imagick.resetimagepage.php
Last Updated :
17 Dec, 2019
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...