라이브러리
[PHP] GmagickDraw::setstrokewidth - 객체 윤곽선을 그리는 데 사용되는 선의 너비를 설정합니다.
PHP에서 GmagickDraw::setstrokewidth는 GmagickDraw 클래스의 메서드입니다. 이 메서드는 선의 너비를 설정하는 데 사용됩니다.
GmagickDraw::setstrokewidth 사용법
GmagickDraw::setstrokewidth 메서드는 다음과 같은 형식으로 사용됩니다.
#hostingforum.kr
php
GmagickDraw::setstrokewidth(int $width)
- `$width` : 선의 너비를 설정합니다. 단위는 픽셀입니다.
예제
다음 예제에서는 GmagickDraw::setstrokewidth 메서드를 사용하여 선의 너비를 설정하고, 그 결과를 출력합니다.
#hostingforum.kr
php
<?php
// Gmagick 객체 생성
$gmagick = new Gmagick();
// GmagickDraw 객체 생성
$draw = new GmagickDraw();
// 선의 너비를 5픽셀로 설정
$draw->setstrokewidth(5);
// 선을 그립니다.
$draw->setfillcolor('none');
$draw->setstrokecolor('red');
$draw->rectangle(10, 10, 100, 100);
// GmagickImage 객체 생성
$image = new Gmagick();
$image->newImage(150, 150, 'white');
$image->drawImage($draw);
// 이미지 출력
$image->setImageFormat('png');
$image->write('output.png');
?>
이 예제에서는 선의 너비를 5픽셀로 설정하고, 그 결과를 PNG 파일로 출력합니다.
참고
- GmagickDraw 클래스의 메서드 목록: https://www.php.net/manual/en/class.gmagickdraw.php
- Gmagick 클래스의 메서드 목록: https://www.php.net/manual/en/class.gmagick.php
- GmagickDraw::setstrokewidth 메서드 설명: https://www.php.net/manual/en/gmagickdraw.setstrokewidth.php
-
- 나우호스팅 @pcs8404
-
호스팅포럼 화이팅!
댓글목록
등록된 댓글이 없습니다.