Polyline Stroke

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
Posts: 2
Joined: 2013-02-14T07:28:02-07:00
Authentication code: 6789

Polyline Stroke

Post by alfaalex »

Greetings, I'm trying to set the stroke for a polyline but not working. Linejoin and linecap drawing a beveled corner. Where is the issue?

This is the code:

Code: Select all

$stroke = new Imagick();
$stroke->newImage(400, 400, new ImagickPixel("none"));

$draw = new ImagickDraw();

$x = 100;
$y = 100;
$x1 = 300;
$y1 = 200;
$coo1 = array(
		array('x' => $x,'y' => $y),
		array('x' => $x1,'y' => $y),
		array('x' => $x1,'y' => $y1),
		array('x' => $x,'y' => $y1),
		array('x' => $x,'y' => $y),
$stroke->drawImage( $draw );
header( "Content-Type: image/png" );
echo $stroke;
This is the image generated:

This is what I would:

test2.png (2.05 KiB) Viewed 4767 times
test2.php.png (1.96 KiB) Viewed 4767 times
Post Reply