android中的路径交叉 [英] Path intersection in android
本文介绍了android中的路径交叉的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的 android 代码中有 2 个路径对象.我一直尝试检查这些路径是否相交,但无法做到.如何检查路径是否相交.感谢任何好的回应,谢谢 !
I have 2 path objects in my android code.I have tried all the way to check whether these paths are intersected or not, but not able to do it. How can I check whether the paths are intersected or not. Appreciate any good response, Thanks !
推荐答案
看看 Region.op
我还没有尝试过,但我建议使用:
I haven't tried it but I would suggest to use:
Region.setPath(Path path, Region clip);
从你的两个路径中获取一个区域,然后你可以使用:
to get a region from both of your paths and afterwards you can use:
if (region1.op(region2,Region.Op.INTERSECT)) {
// intersection
}
检查交叉点...
这篇关于android中的路径交叉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文