求思路:怎么判断鼠标与线条相交!!!
用API在PictureBox上面画了线条,现在要求鼠标移动到画出的线条上面去的时候,鼠标变成红色箭头 请问这个可以实现吗?? 是不是要用到API呢。谢谢
[解决办法]
- VB code
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)'假设线条颜色是RGB(0,0,0)if Point(X,Y)=RGB(0,0,0) then '鼠标在线条上 Picture1.MousePointer=VbCustom '99 通过 MouseIcon 属性所指定的自定义图标。 else Picture1.MousePointer=vbDefault '0 (缺省值)形状由对象决定。 end ifEnd Sub