
ImagickDraw::pathCurveToSmoothAbsolute 메소드는 Absolute 방식으로 곡선을 그릴 때 사용되며, x, y, x2, y2, x, y 순으로 좌표를 입력합니다.
이 메소드는 곡선의 시작점과 끝점을 연결하는 선분을 그리지 않습니다.
예시 코드는 다음과 같습니다.
#hostingforum.kr
php
$draw = new ImagickDraw();
$draw->setStrokeColor('black');
$draw->setFillColor('none');
$draw->setStrokeWidth(2);
// 곡선의 시작점
$draw->pathMoveToAbsolute(100, 100);
// 곡선의 첫 번째 세그먼트
$draw->pathCurveToSmoothAbsolute(200, 200, 250, 100, 300, 200);
// 곡선의 두 번째 세그먼트
$draw->pathCurveToSmoothAbsolute(400, 300, 450, 200, 500, 300);
$imagick = new Imagick();
$imagick->newImage(600, 400, 'white');
$imagick->drawImage($draw);
$imagick->setImageFormat('png');
$imagick->writeImage('curve.png');
이 코드는 Absolute 방식으로 곡선을 그리는 방법을 보여줍니다.
2025-06-14 14:18