5

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?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Marlord
  • 1,144
  • 2
  • 13
  • 24

1 Answers1

7

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).

jewelsea
  • 150,031
  • 14
  • 366
  • 406
  • I'm trying to learn about SVGPath and Region. Basically, they can do the same basic function, but i've not seen the differences. Do you know when to use each one? – Marlord Jun 11 '14 at 14:20