Drawing a Region with CSS -fx-shape. How it is possible?


I'm looking a way to draw shapes in a Region (JavaFX8)

I've seen some examples that set the region style like this:

-fx-shape            : "M 3.0313 0 L 0 74 L 7.9688 74 L 4.9375 0 L 3.0313 0 Z";

Can anyone give an explanation of the meaning of this string?

Is there any way to create this type of string using Visual Software?

3/16/2017 4:43:14 PM

Accepted Answer

The shape string is an SVG Path.

Note the shape string for a region is the shape of the region, not a shape in a region. If you want to create shapes based on paths to put in a region, then use an SVGPath and not a Region.

You can use an SVG editor to create SVG paths.

Recommending particular SVG editors is off topic for StackOverflow, try Google and you may find Inkscape (and it's option Path | Object to Path).

6/10/2014 6:00:07 AM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow