PHP | ImagickPixelIterator setIteratorLastRow() Function
Last Updated :
14 Jan, 2020
The ImagickPixelIterator::setIteratorLastRow() function is an inbuilt function in PHP which is used to set the pixel iterator to the last pixel row.
Syntax:
bool ImagickPixelIterator::setIteratorLastRow( void )
Parameters: This function doesn’t accepts any parameters.
Return Value: This function returns TRUE on success.
Below programs illustrate the ImagickPixelIterator::setIteratorLastRow() function in PHP:
Program 1:
<?php
$imagick = new Imagick(
$pixelIterator = $imagick ->getPixelIterator();
echo "Current row is " . $pixelIterator ->getIteratorRow();
$pixelIterator ->setIteratorLastRow();
echo "<br>Current row is " . $pixelIterator ->getIteratorRow();
?>
|
Output:
Current row is 0
Current row is 183
Program 2:
<?php
$imagick = new Imagick();
$imagick ->newImage(800, 250, 'black' );
$pixelIterator = $imagick ->getPixelIterator();
$pixelIterator ->setIteratorLastRow();
$row = $pixelIterator ->getIteratorRow() + 1;
echo "<br>Total number of rows in image is " . $row ;
?>
|
Output:
Total number of rows in image is 250
Reference: https://www.php.net/manual/en/imagickpixeliterator.setiteratorlastrow.php
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...