PolygonHotSpot 与 RectangleHotSpot;无法选择所有 PolygonHotSpot?
我正在使用 VB.NET 以编程方式创建一个 ImageMap
,然后向其中添加 PolygonHotSpot
。它有点有效,但我注意到当我将鼠标悬停在PolygonHotSpot
上时,里面有不可可选择的部分/点(鼠标光标从手上改变)到默认光标)。
我添加到 PolygonHotSpot
的坐标是(在本例中是简单的矩形):
150,99,270,213,270,99,150,213
当我将其更改为 RectangleHotSpot
并设置 Top
、Bottom
、Left
时,我注意到>, Right
基于这些相同的坐标,它工作完美,并且内部没有任何不可选择的部分。我需要使用 PolygonHotSpot 而不是 RectangleHotSpot 的原因是每个热点可能有 4 个以上的边(每次都会不同)。
我是否做错了什么,或者我应该检查是否只有 4 个坐标可以继续并将其转换为 RectangleHotSpot ?或者有人有过使用PolygonHotSpot
的经验,也许我缺少一个设置?我已将 HotSpotMode
设置为 PostBack 等(适用于 RectangleHotSpot
的所有内容)。
I am programatically creating an ImageMap
using VB.NET and then adding PolygonHotSpot
s to it. It kind of works, but I notice when I hover my mouse over the PolygonHotSpot
, there are parts/spots inside that aren't selectable (the mouse cursor changes from the hand to the default cursor).
The coordinates I'm adding to my PolygonHotSpot
are (which for this example is simple rectangle):
150,99,270,213,270,99,150,213
I noticed when I change this to a RectangleHotSpot
, and set the Top
, Bottom
, Left
, Right
based on those same coordinates, it works perfectly, and there aren't any parts inside that aren't selectable. The reason I need to be using PolygonHotSpot
rather than RectangleHotSpot
is because each hotspot could have more than 4 sides (it will be different every time).
Am I doing something wrong, or should I be checking that if I only have 4 coordinates to go ahead and convert it to a RectangleHotSpot
? Or has anyone had any experience with a PolygonHotSpot
, maybe I'm missing a setting? I've got the HotSpotMode
set to PostBack, etc (everything that worked for the RectangleHotSpot
).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您绘制的不是一个矩形,而是一个 X。如果您将坐标按顺时针顺序 IIRC 输入,您将得到矩形。
实际上,顺时针顺序似乎并不重要,但顺序确实如此:
“150,99,270,99,270,213,150,213”应该有效。
You are not drawing a rectangle, but an X. If you put your coordinates in clockwise order IIRC, you will get your rectangle.
Actually, the clockwise order doesn't seem to matter, but the order does:
"150,99,270,99,270,213,150,213" should work.