How to draw filled polygon?

前端 未结 8 2103
生来不讨喜
生来不讨喜 2020-12-01 08:57

How to draw filled polygon in Android ?

8条回答
  •  青春惊慌失措
    2020-12-01 09:37

    BTW - I discovered that once you begin creating your path, any moveTo commands within the path will mean that the shape is left unfilled.

    It makes sense when you think about it, that Android/Java would leave the shape unfilled as the moveTo would represent a break in the polygon.

    However I've seen some tutorials like this How to draw a filled triangle in android canvas?

    which have moveTo's after each lineTo. Even though this may result in an unbroken polygon, Android assumes that a moveTo represents a break in the polygon.

提交回复
热议问题