有没有一种简单的方法来判断两个字符/符号是否重叠? [英] Is there an easy way to tell if two characters/symbols overlap?

查看:155
本文介绍了有没有一种简单的方法来判断两个字符/符号是否重叠?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要的是比字符/符号矩形更精致的东西,我想仅在黑色部分触摸时才检测到重叠,以便可以在任意位置和尽可能靠近的位置绘制自定义符号,甚至可能重叠.

使用路径是否可以让人们检测字符/符号是否重叠,并且有一些真正简单的代码吗?在我的搜索中似乎找不到任何内容.谢谢.

What I want is something more refined than just the character/symbol rect, I want to detect overlapping only when the black parts touch so that custom symbols could be drawn at any position and a close as possible, possibly even allowed to overlap.

Would using paths allow one to detect whether the characters/symbols overlap and is there some really simple code? Can''t seem to find any in my searches. Thanks.

推荐答案

好吧,如果两个位模式重叠,则它们之间的按位XOR(^)和OR(|)操作将得出不同的结果.
可能是一个起点.
Well, if two bit patterns overlap, then the bitwise XOR (^) and OR (|) operations between them give different results.
It may be a starting point.


if (CountOfBlackBits(hBmpComposed) <
    CountOfBlackBits(hBmpA) +
    CountOfBlackBits(hBmpB)) {
  // yes :)
...
}


这篇关于有没有一种简单的方法来判断两个字符/符号是否重叠?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆