<?php
// Create a new imagick object
$imagick = new Imagick();
// Read the image
$pngfn='myfile.png';
$imagick->readImage($pngfn);
// Display the image
header("Content-Type: image/png");
echo $imagick->getImageBlob();
?>
PHP - Manual: Imagick::getImage
2024-11-14
(PECL imagick 2, PECL imagick 3)
Imagick::getImage — Returns a new Imagick object
Returns a new Imagick object with the current image sequence.
此函数没有参数。
Returns a new Imagick object with the current image sequence.
错误时抛出 ImagickException。