Luca Manganini - Omnia Sim wrote:

Hi Bruno,

I tried to do what you suggested me, but unfortunatly the result isn't
changed!

I had very little time yesterday and my answer was (again) not correct.
You are using the convenience method arc.
This method uses the method bezierArc that can switch coordinates
in order to provide an array of parameters that can be used in the
curveTo method.
If you want to connect the ends of two curves, you don't know which
end is used as the start point and which one is used as the end point.
So it's better NOT to use arc, but to construct the bézier curves yourself.

In the following example, you see how I draw a curve
from (100, 600) to (300, 400). Coordinate (250, 600)
is used as control point for the start point. Coordinate (300, 550)
is used as control point for the end point.
Then I draw a line from (300, 400) to (200, 400)
and a curve from (200, 400) to (100, 500).
Again two control points are used.

cb.setColorStroke(Color.black);
cb.setColorFill(Color.yellow);
cb.setLineWidth(0f);
cb.moveTo(100f, 600f);
cb.curveTo(250f, 600f, 300f, 550f, 300f, 400f);
cb.lineTo(200f, 400f);
cb.curveTo(200f, 475f, 175f, 500f, 100f, 500f);
cb.closePathFillStroke();

You will find more info on bézier curves in the PDF Reference
manual and elsewhere on the net.

Note that it is NOT a good idea to set the line width to 0.
If you don't want a line to be drawn around the shape,
use closePathFill instead of closePathStroke.

Again sorry for my earlier answers. This is a more fundated
(and tested) answer ;-)
br,
Bruno


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to