Forum und email

Imagick::distortImage

(No version information available, might be only in CVS)

Imagick::distortImage — Distorts an image using various distortion methods

說明

bool Imagick::distortImage ( int $method , array $arguments , bool $bestfit )
Warning

本函式是實驗性的。這個函式的行為、名稱、和關於此函式的任何其他文件在未來PHP的發行中可能會在不通知的情況下改變。 使用此函式需自行承擔風險。

Distorts an image using various distortion methods, by mapping color lookups of the source image to a new destination image usally of the same size as the source image, unless 'bestfit' is set to true. If 'bestfit' is enabled, and distortion allows it, the destination image is adjusted to ensure the whole source 'image' will just fit within the final destination image, which will be sized and offset accordingly. Also in many cases the virtual offset of the source image will be taken into account in the mapping. This functionality is present if Imagick is compiled against ImageMagick 6.3.6 or later.

參數

method

The method of image distortion. See distortion constants

arguments

The arguments for this distortion method

bestfit

Attempt to resize destination to fit distorted source

Return值

Returns TRUE on success.

錯誤/例外

Throws ImagickException on error.

範例

Example#1 Using Imagick::distortImage():

Distort an image and write it to the disk.

<?php

$im 
= new imagick"example.jpg" );

$im->distortImageImagick::DISTORTION_PERSPECTIVE, array( 7,404,304,1244,12385,122100,12385,2100,30 ), true );

$im->writeImage"example_out.jpg" );

?>