开发者

does android sdk give any convenience methods for converting Shape to Path?

开发者 https://www.devze.com 2023-01-12 05:34 出处:网络
the Canvas class does not take Shape as a parameter for any of its methods.There is no drawShape or clipShape, etc...So, I need to use Path instead.Does android sdk expose any way to convert Shape to

the Canvas class does not take Shape as a parameter for any of its methods. There is no drawShape or clipShape, etc... So, I need to use Path instead. Does android sdk expose any way to convert Shape to Path or Path to shape? I haven't been 开发者_StackOverflow社区able to find relationship any between the 2 classes...?

Thank you


Shape is just an abstraction over the Canvas. It may or may not use a Path internally. You cannot convert a Shape to a Path directly, but all Shapes can be implemented using Path. You can however create a Shape from a Path using the PathShape class.

0

精彩评论

暂无评论...
验证码 换一张
取 消