
ImagickDraw::pathLineToHorizontalAbsolute 함수는 현재 위치에서 가로 방향으로 선을 그립니다. 이 함수의 파라미터 중 'x'는 선의 끝점의 x좌표를 의미하고, 'y'는 선의 시작점의 y좌표를 의미합니다.
예를 들어, 'ImagickDraw::pathLineToHorizontalAbsolute(10, 20)'를 사용한 경우, 선은 현재 위치에서 x=10, y=20에 위치할 것입니다.
이 함수를 사용하여 선을 그리는 방법은 다음과 같습니다.
#hostingforum.kr
php
$draw = new ImagickDraw();
$draw->setStrokeColor('black');
$draw->setFillColor('none');
$draw->pathStart();
$draw->pathLineToHorizontalAbsolute(10, 20);
$draw->pathLineToHorizontalAbsolute(30, 20); // 현재 위치에서 x=30에 선을 그립니다.
$draw->pathFinish();
$imagick = new Imagick();
$imagick->newImage(40, 40, 'white');
$imagick->drawImage($draw);
$imagick->setImageFormat('png');
$imagick->writeImage('example.png');
이 코드는 현재 위치에서 x=10, y=20에 선을 그립니다. 그리고 현재 위치에서 x=30에 선을 그립니다.
2025-06-13 21:20