画像の遠近法を設定します。空白のポリゴンを持つラップトップの画像があります
別の画像を空白の領域にプルする必要があります。このような:
だから、私は動的歪みのためにこのコードを持っています:
$controlPoints = array( 0, 0,
0, 0,
0, $im->getImageHeight(),
0, $im->getImageHeight(),
$im->getImageWidth(), 0,
$im->getImageWidth(), 0,
$im->getImageWidth(), $im->getImageHeight(),
$im->getImageWidth(), $im->getImageHeight());
/* Perform the distortion */
$im->distortImage(Imagick::DISTORTION_PERSPECTIVE, $controlPoints, true);
$ controlPoints配列を設定するにはどうすればよいですか?画像の各隅に4つの座標を設定することはできませんか?残念ながら、imageick::歪み画像のドキュメントは不十分です。
問題は、別の歪み方法を使用して解決されます。
$im->cropImage( 125, 121, $center_x, $center_y );
$controlPoints = array(
0,0, 35,20, # top left
190,0, 150,30, # top right
0,205, -16,105, # bottom right
176,135, 115,105 # bottum left
);
/* Perform the distortion */
$im->distortImage(Imagick::DISTORTION_BILINEAR, $controlPoints, true);