问题
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?
回答1:
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
).
来源:https://stackoverflow.com/questions/24124819/drawing-a-region-with-css-fx-shape-how-it-is-possible