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

久未见 提交于 2020-01-14 10:37:29

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!