ImageMagick ImagickDraw::line
(PECL imagick 2, PECL imagick 3)
ImagickDraw::line — 선을 그립니다
설명
public ImagickDraw::line( float $sx, float $sy, float $ex, float $ey ): bool
경고 이 함수는 현재 문서화되어 있지 않습니다. 해당 인수 목록만 사용할 수 있습니다.
현재 획 색상, 획 불투명도 및 획 너비를 사용하여 이미지에 선을 그립니다.
매개변수
sx
- starting x coordinate
sy
- starting y coordinate
ex
- ending x coordinate
ey
- ending y coordinate
반환 값
값이 반환되지 않습니다.
Examples
예제 #1 ImagickDraw::line() 예제
<?php
function line($strokeColor, $fillColor, $backgroundColor) {
$draw = new \ImagickDraw();
$draw->setStrokeColor($strokeColor);
$draw->setFillColor($fillColor);
$draw->setStrokeWidth(2);
$draw->setFontSize(72);
$draw->line(125, 70, 100, 50);
$draw->line(350, 170, 100, 150);
$imagick = new \Imagick();
$imagick->newImage(500, 500, $backgroundColor);
$imagick->setImageFormat("png");
$imagick->drawImage($draw);
header("Content-Type: image/png");
echo $imagick->getImageBlob();
}
?>