Sending both Image(PNG) and ImageMaps from the server to the client [message #202403] |
Wed, 22 November 2006 08:48 |
Eclipse User |
|
|
|
Originally posted by: debbani11.yahoo.com
Hi,
I'm dynamically generating a chart on the server which I later
render it on an HTML page. I'm generating a PNG image and am able to
render that fine on the HTML page. Now, I'd like to show tooltips as
well as have the capability to do an URL Redirect, so I create Image
maps using IImageMapEmitter. I was wondering how can I use this image
map that I created on the server from the client side as my request only
returns an image but I would need the data of the image map as well on
the client to add it to my innerHTML tag. Any help would be appreciated.
This is the code snippet that returns the image to the client:
response.setContentType("image/png");
OutputStream os = response.getOutputStream();
ImageIO.write(img, "png", os);
os.close();
Was wondering how would I pass the imageMap back here as well.
Currently my innerHtml looks like:
function invokeBirtChart()
{
url = _contextPath + '/getBirtChart.rd?rand=' + Math.random();
var chartImage = new Image;
chartImage.name = "testChart";
chartImage.onload = displayBirtChart;
chartImage.src = url;
}
function displayBirtChart()
{
obj=document.getElementById("chart");
if (obj) {
obj.innerHTML="<img width='250' height='150' src='"+this.src+"'>";
}
}
Thanks in advance,
Debbani
|
|
|
Powered by
FUDForum. Page generated in 0.03790 seconds