PHPCon Poland 2024


(PECL imagick 2, PECL imagick 3)

ImagickDraw::pathStartDeclares the start of a path drawing list


public ImagickDraw::pathStart(): bool

Esta função não está documentada; apenas a lista de argumentos está disponível.

Declares the start of a path drawing list which is terminated by a matching DrawPathFinish() command. All other DrawPath commands must be enclosed between a and a DrawPathFinish() command. This is because path drawing commands are subordinate commands and they do not function by themselves.

Valor Retornado

Nenhum valor é retornado.


Exemplo #1 ImagickDraw::pathStart() example

function pathStart($strokeColor, $fillColor, $backgroundColor) {

$draw = new \ImagickDraw();



$draw->pathMoveToAbsolute(50, 50);
$draw->pathLineToAbsolute(100, 50);
$draw->pathLineToRelative(0, 50);

$draw->pathMoveToAbsolute(50, 50);
$draw->pathMoveToRelative(300, 0);
$draw->pathLineToRelative(50, 0);

$draw->pathMoveToAbsolute(50, 300);
$draw->pathCurveToAbsolute(50, 300, 100, 200, 300, 300);

$imagick = new \Imagick();
$imagick->newImage(500, 500, $backgroundColor);


header("Content-Type: image/png");


add a note

User Contributed Notes 1 note

4 months ago
Between $draw->pathStart() and $draw->pathFinish() you would need to start with $draw->pathMoveToAbsolute(x, y) to initialise the position. All the subsequent calls to "path functions" (including absolute ones) will continue the path.

I would expect pathStart to accept the starting coordinates, and it took me a while to realise that there you need to initialise with a different function.
To Top