라이브러리
[PHP] GmagickDraw::getstrokewidth - 객체 윤곽선을 그리는 데 사용되는 획의 너비를 반환합니다.
GmagickDraw::getstrokewidth 메서드
GmagickDraw::getstrokewidth 메서드는 현재 선의 너비를 반환합니다. 이 메서드는 GmagickDraw 객체의 속성을 반환합니다.
사용법
#hostingforum.kr
php
$gmagick = new Gmagick();
$gmagick->readImage('image.png');
$draw = new GmagickDraw();
// 선의 너비를 설정합니다.
$draw->setStrokeWidth(5);
// 현재 선의 너비를 가져옵니다.
$strokewidth = $draw->getStrokeWidth();
echo "현재 선의 너비: $strokewidth";
예제
#hostingforum.kr
php
$gmagick = new Gmagick();
$gmagick->readImage('image.png');
$draw = new GmagickDraw();
// 선의 너비를 설정합니다.
$draw->setStrokeWidth(5);
// 현재 선의 너비를 가져옵니다.
$strokewidth = $draw->getStrokeWidth();
echo "현재 선의 너비: $strokewidth";
// 선의 색상을 설정합니다.
$draw->setStrokeColor('red');
// 선을 그립니다.
$draw->line(10, 10, 100, 100);
// 이미지에 선을 그립니다.
$gmagick->drawImage($draw);
// 이미지 파일로 저장합니다.
$gmagick->writeImage('output.png');
이 예제에서는 선의 너비를 5로 설정하고 현재 선의 너비를 가져옵니다. 그리고 선의 색상을 빨간색으로 설정하고 선을 그립니다. 마지막으로 이미지 파일로 저장합니다.
참고
* GmagickDraw::getstrokewidth 메서드는 현재 선의 너비를 반환합니다.
* GmagickDraw::setStrokeWidth 메서드는 선의 너비를 설정합니다.
* GmagickDraw::setStrokeColor 메서드는 선의 색상을 설정합니다.
* Gmagick::drawImage 메서드는 이미지에 선을 그립니다.
* Gmagick::writeImage 메서드는 이미지 파일로 저장합니다.
-
- 나우호스팅 @pcs8404
-
호스팅포럼 화이팅!
댓글목록
등록된 댓글이 없습니다.