1
이미지 관점을 설정하려고합니다. 빈 다각형이있는 랩톱 이미지가 있습니다. imagick :: distortimage
빈 영역에 다른 이미지를 가져와야합니다. 이처럼 :
$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);
가 어떻게 $ 제어점 배열을 설정할 수 있습니다 : 그래서
, 나는 동적 왜곡이 코드가? 이미지의 각 구석에 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);