Draw ArcTo on canvas

I have a List<PathElement> that I would like to have in order to either add to the scenario chart or draw on the canvas. The first is easy, as I can just create a Path node and add it to the scene. The second requires mapping from PathElement calls to the GraphicsContext . For most things, it's pretty simple, with the exception of ArcTo and GraphicsContext.arcTo , which are parameterized differently.

ArcTo accepts the following ArcTo(double radiusX, double radiusY, double xAxisRotation, double x, double y, boolean largeArcFlag, boolean sweepFlag)

While GraphicsContext.arcTo accepts arcTo(double x1, double y1, double x2, double y2, double radius) . In addition, the GraphicsContext has an arc that accepts arc(double centerX, double centerY, double radiusX, double radiusY, double startAngle, double length) .

How can I make ArcTo on canvas using the methods available in GraphicsContext ?

+8
javafx
source share
1 answer

Hope this example link helps you.

Work with canvas | JavaFx 2

0
source share

All Articles