
ImagickDraw::setStrokePatternURL 메소드는 stroke pattern URL을 설정하는 데 사용됩니다.
이 메소드는 URL을 문자열로 받습니다. URL은 HTTP나 HTTPS 프로토콜로 시작해야 하며, 이미지 파일의 URL이어야 합니다. 예를 들어, "http://example.com/image.png"이나 "https://example.com/image.png"과 같은 형식의 URL을 사용할 수 있습니다.
URL을 설정한 후, ImagickDraw 클래스의 다른 메소드를 사용하여 stroke pattern을 적용할 수 있습니다. 예를 들어, ImagickDraw::setStrokeColor 메소드를 사용하여 stroke color을 설정할 수 있습니다.
이 메소드를 사용하는 예제는 다음과 같습니다.
#hostingforum.kr
php
$draw = new ImagickDraw();
$draw->setStrokePatternURL("http://example.com/image.png");
$draw->setStrokeColor("black");
$draw->setStrokeWidth(2);
$draw->rectangle(10, 10, 100, 100);
$imagick = new Imagick();
$imagick->newImage(120, 120, "white");
$imagick->setImageFormat("png");
$imagick->drawImage($draw);
$imagick->writeImage("output.png");
이 예제에서는 stroke pattern URL을 설정하고 stroke color, stroke width를 설정한 후, rectangle를 그립니다.
2025-07-29 00:01