> Can we create an image map for a dynamically generated JPEG image.
> example: My program generates a bar chart as a JPEG image. I want to
> link the bars of the chart to screens displaying corresponding data.
hemarangain@gmail.com wrote:
>> Can we create an image map for a dynamically generated JPEG image.
>> example: My program generates a bar chart as a JPEG image. I want to
>> link the bars of the chart to screens displaying corresponding data.
> Define "my program" - a web app? Surely that's what you mean, since
> image maps usually imply HTML/web is being used...
Assuming that's true, you define a standard map element in the JSP:
(untested)
<img src="Display?image=${image}" usemap="barlinks" ... />
<map name="barlinks">
<c:forEach var="barloc" items="${imagebars}" >
<area href="${barloc.href}" coords="${barloc.coords}" />
</c:forEach>
</map>
Display would be a servlet that streams the jpeg to response.out.
- Lew