English 中文(简体)
How could I reduce the complexity of an image map?
原标题:

I m using KImageMapEditor on Linux (Ubuntu) to create an image map. The shapes in the image are a little complex so I m using the freehand tool to draw them. However, this is really the same as the polygon tool so the shapes have ended up with a lot of points, which has made the HTML pretty huge.

Does anyone know of a way to reduce the complexity of the shapes, like "smoothing out" the lines?

I should also mention the reason I want the shapes to be fairly accurate is because I m intending to do something like this, where each shape is highlighted on mouseover: http://davidlynch.org/js/maphilight/docs/demo_usa.html

最佳回答

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".

问题回答

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





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签