bernie2436
bernie2436

Reputation: 23911

draw a curve that bends around multiple points in php?

I want to draw a dynamically generated line that bends around n points in php, depending on input. I know I could use image arc and painstakingly get the curves to overlap at the proper angles so that multiple curves give the illusion of a single bendy line. But is there is an easier/cleaner way?

I basically want to do this:

enter image description here

Upvotes: 0

Views: 616

Answers (2)

James
James

Reputation: 4783

You could use ImageMagick to create an image of the output you want. I've always found it pretty straightforward.

eg
http://imagemagick.org/Usage/draw/#bezier
http://php.net/manual/en/imagickdraw.bezier.php

Upvotes: 1

str8
str8

Reputation: 242

If you wish the client side to render this I recommend using the canvas tag See reference here: http://www.html5canvastutorials.com/tutorials/html5-canvas-bezier-curves/

Or use imagemagick backend if you with the server side to do it

look up Bezier Primitive on page http://www.imagemagick.org/Usage/draw/#bezier

Upvotes: 1

Related Questions