动态影像图 [英] Dynamic Image Map

查看:75
本文介绍了动态影像图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!!!

我想知道是否可以动态创建图像映射.我正在使用MVCc#和asp.net.

我有这个:
带有蚁目itemCoor的Arraylist,对于要绘制的每个点,它们的坐标都在X和Y坐标之内:

Hi!!!

I was wondering if it''s possible to create an Image Map dinamically. I''m working with MVC with c# and asp.net.

What I have is this:
An Arraylist with ant itemCoor, that have inside the coordinate''s X and Y for each point that I have to draw:

ArrayList points= new ArrayList();
int[] itemCoor = new int[2];
itemCoor[0] = 1;
itemCoor[1] = 100;
points.Add(itemCoor);
.....



显然,每次我需要在图像上绘制图像映射时,它都位于不同的图像中,并且具有不同的坐标数组列表.

我需要做的是在每对坐标中绘制一个带有小圆圈的图像地图.我必须遍历arraylist,搜索坐标,然后以动态方式创建图像映射.

有可能吗?

感谢很多!!!



Obviously, every time I need to draw the image map over an image, it''s in a different image and with diferent arraylist of coordinates.

and what I need to do is to draw an Image map with small circles in each pair of coordinates. I have to go over the arraylist, searching for the coordinates, and dinamically creating the image map.

Is it possible?

THANKS A LOT!!!

推荐答案

是的,这是可以做到的(并且已经做到了).您可以使用简单的JavaScript动态更改地图标签的内容(甚至其中的单个区域标签).在许多项目中都这样做.适用于所有主流浏览器.

基本步骤:
1.提取数据
2.创建一个新的区域节点.
3.设置其内部html. (请记住要设置一个id,以便以后使用它)
4.将元素添加到地图父级.

完成
Yes, this can be done (and has been). You can dynamically change the map tags content (or even individual area tags within) using simple JavaScript. Have done so in a number of projects. Works with all major browsers.

Basic steps:
1. Fetch data
2. Create a new area node.
3. Set its inner html. (remember to set an id so you can refer to it later)
4. Add element to the map parent.

done


我不确定我是否完全理解您要尝试执行的操作.

但是,现有代码中有一件事. 可能将其更改为:
I am not sure that I completely understand what it is that you are trying to do.

However, one thing from your existing code. It might be more advantageous to change it to:
  ArrayList points= new ArrayList();
  points.Add(new Point(1, 100));
.....


因为,如果您正在画图,则有可能必须将itemCoor转换为Point.但是,正如我之前所说,这完全取决于您要执行的操作.

稍后,您将讨论绘制圆,为此,您将不仅需要X和Y坐标.

因此,如果您可以以不同的方式解释问题,则可能会获得更多帮助


as, if you are drawing the chances are that you will have to convert your itemCoor to a Point at some time. As I said earlier, though, this would depend on exactly what it is that you are trying to do.

Later, you talk about drawing circles and for that you will need more than just an X and a Y coordinate.

So if you could explain your problem slightly differently, you might get more help


好!

这就是我所做的.

在aspx页面中,我写了
]]>

在aspx.cs中,我写了
受保护的void函数(){
字符串prueba ="<地图名称=" \"id =" \>";
Response.Write(prueba);
}

而且有效!!!

谢谢大家!
Ok!!

This is what I did.

In aspx page, I wrote
]]>

And in aspx.cs, I wrote
protected void function(){
String prueba="";
Response.Write(prueba);
}

And It works!!!

Thank you guys!!


这篇关于动态影像图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆