라이브러리
[PHP] ImagickDraw::getStrokeColor - 객체 윤곽선을 획으로 그리는 데 사용된 색상을 반환합니다.
ImagickDraw::getStrokeColor
ImagickDraw::getStrokeColor는 ImagickDraw 객체의 stroke color를 반환하는 메서드입니다. stroke color는 이미지에 그림을 그릴 때 사용하는 색상입니다.
사용법
ImagickDraw::getStrokeColor를 사용하려면 ImagickDraw 객체를 먼저 생성해야 합니다. 그 후에 stroke color를 설정하고, getStrokeColor를 호출하여 stroke color를 반환받을 수 있습니다.
예제
#hostingforum.kr
php
// ImagickDraw 객체 생성
$draw = new ImagickDraw();
// stroke color를 설정합니다.
$draw->setStrokeColor('red');
// stroke color를 반환합니다.
$strokeColor = $draw->getStrokeColor();
// 반환된 stroke color를 출력합니다.
print($strokeColor . "
"); // red
// stroke color를 변경합니다.
$draw->setStrokeColor('blue');
// 변경된 stroke color를 반환합니다.
$strokeColor = $draw->getStrokeColor();
// 반환된 stroke color를 출력합니다.
print($strokeColor . "
"); // blue
설명
ImagickDraw::getStrokeColor는 ImagickDraw 객체의 stroke color를 반환합니다. stroke color는 이미지에 그림을 그릴 때 사용하는 색상입니다. 이 메서드는 stroke color를 설정한 후에 호출하여 stroke color를 반환받을 수 있습니다.
참고
ImagickDraw::getStrokeColor는 ImagickDraw 객체의 stroke color를 반환하는 메서드입니다. stroke color는 이미지에 그림을 그릴 때 사용하는 색상입니다. 이 메서드를 사용하려면 ImagickDraw 객체를 먼저 생성해야 합니다. 그 후에 stroke color를 설정하고, getStrokeColor를 호출하여 stroke color를 반환받을 수 있습니다.
예제
#hostingforum.kr
php
// Imagick 객체 생성
$image = new Imagick();
// ImagickDraw 객체 생성
$draw = new ImagickDraw();
// 이미지에 그림을 그립니다.
$draw->setStrokeColor('red');
$draw->setFillColor('blue');
$draw->rectangle(10, 10, 50, 50);
$image->annotateImage($draw, 10, 60, 0, 'ImagickDraw::getStrokeColor');
// 이미지 저장
$image->write('example.png');
이 예제에서는 Imagick 객체를 생성하고, ImagickDraw 객체를 생성합니다. 그 후에 ImagickDraw 객체의 stroke color를 설정하고, fill color를 설정합니다. 그리고 rectangle를 그립니다. 그 후에 ImagickDraw::getStrokeColor를 호출하여 stroke color를 반환받습니다. 반환된 stroke color를 사용하여 이미지에 annotation을 추가합니다. 마지막으로 이미지 저장합니다.
-
- 나우호스팅 @pcs8404
-
호스팅포럼 화이팅!
댓글목록
등록된 댓글이 없습니다.