本文介绍了不规则形状的按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我正在寻找一种方法来检查我的光标当前是否在特定的绘图上,以便可以突出显示它.
假设这可能是形状:
Hello everyone,
I am looking for a method to check if my cursor is currently over a specific draw so it can be highlighted.
Let''s say this is may shape:
___________
/ /
/__________/
如您所见,有一些备用空间(按钮通常是直框).
如何排除剩余空间?
大家知道,我使用GraphicsPath绘制了线条.
As you can obviously see, there''s a bit of spare space (buttons are usually straight boxes).
How can I exclude the spare space?
Just so you know, I draw the lines using a GraphicsPath.
推荐答案
Pont point = ...; //Set mouse coordinates here.
GraphicsPath path = ...; // Create your path here.
if(path.IsVisible(point)) ... // Check if mouse coordinates are within path
问候,
-MRB
Regards,
-MRB
这篇关于不规则形状的按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!