I need to draw a parallelogram using imagemagick, I’ve looked at the documentation but can’t find anything that will let me do it.
Ideally I want the parallelogram to scale depending on the text it wrapped.
Anyone had success with this sort of thing before?
Cheers
Draw two filled triangles.
Pretty much any shape can be drawn using triangles. Dividing a parallelogram into two triangles is trivial.
So for:
Draw the tiangle formed by the points (A, B, C) then the one formed by (B, C, D), and you’re done.
I’m not sure what you mean by wanting it “to scale depending on the text it wrapped”, but if you know the bounding box of the text (should be fairly easy to work out, but I use GD for images so I don’t know how it’s done in imagemagick), you can get the coordinates of your four points.