vicentazo
vicentazo

Reputation: 1809

Region around a Path curve

How I can make a Region object around a curve?

I make quadratic Bezier curves with Path objects and, then, I draw them into a Canvas with the drawPath() function. I need to make 'nearby' Region objects around the curves.

Can you help? Thanks!

Upvotes: 3

Views: 397

Answers (1)

Spektre
Spektre

Reputation: 51933

i am not android user but:

  1. what about line width (may be called stroke width)
    • if you can set it to more than 1 pixel than it will draw your path wider
  2. if you need exact shape then you need to transform your path to polygon
    • original beziers will became two
    • one shifted perpendicular to curve on one side
    • the other to opposite side.
    • close begin and end of the path with line, or curve

to get shifted control points just translate them in perpendicular direction from the curve the shift size is half of the region width.

Upvotes: 1

Related Questions