0

我在 Linux (Ubuntu) 上使用KImageMapEditor创建图像映射。图像中的形状有点复杂,所以我使用手绘工具来绘制它们。但是,这实际上与多边形工具相同,因此形状最终带有很多点,这使得 HTML 变得非常庞大。

有谁知道减少形状复杂性的方法,比如“平滑”线条?

我还应该提到我希望形状相当准确的原因是因为我打算做这样的事情,每个形状都在鼠标悬停时突出显示:http: //davidlynch.org/js/maphilight/docs/demo_usa。 html

4

2 回答 2

2

Since users aren't going to click to the pixel, give them some leeway and create a "sloppy" map which roughly outlines each shape instead of clinging to the actual pixel outline.

This is in the same way as you don't expect a click on a link to fail just because you click on the background which shines through the text. You expect the bounding box of the text to act as the click-able area instead of the "black pixels".

于 2009-11-16T16:00:07.680 回答
1

Algorithm: Given three consecutive points, eliminate the middle point if the angle created is less than some tolerated error e. Polygonal path simplification with angle constraint

于 2009-11-16T16:02:01.187 回答