1
votes

I have seen a Flutter component which I would like to transform to Codename One.

Flutter has a Canvas with has a method drawDRRect with "Draws a shape consisting of the difference between two rounded rectangles with the given [Paint]. Whether this shape is filled or stroked (or both) is controlled by [Paint.style]."

Any idea how I would do something similar in Codename One?

1
I guess there is no way to combine shapes, right? - Stefan Eder

1 Answers

0
votes

You can use intersect which lets you intersect two shapes. You can also use shape clipping but that has the drawback of being aliased so I'd keep this as the last resort.

You can draw or fill a shape. Draw will use the stroke style and a color. This isn't as versatile as other 2D API's that include a paint object but is performant.

You can also use mask images if the shape is static in which case you will have anti-aliasing.